K8SPSMDB-1595: set container security context for `pbm-init` container #2283
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.63) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 291 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.340
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #2283"
general
weight: 0.35
shajia-deshaw
CHANGE DESCRIPTION
---
Problem:
The
pbm-initinit container added during physical/PITR restore is missing aSecurityContext, causing pod admission failures in namespaces which has PSA inrestrictedmode. More details in https://github.com/percona/percona-server-mongodb-operator/issues/2250Cause:
updateStatefulSetForPhysicalRestore() calls EntrypointInitContainer() to create the pbm-init container but never assigns SecurityContext after creation - unlike the other caller, InitContainers() in init.go, which does apply it.
Solution:
Assign
cluster.Spec.InitContainerSecurityContextto thepbm-initcontainer after creation (for CR version ≥1.23.0- idk if the version guard that I have here is the right version but per the discussion in the issue, the idea was to allow this for >= 1.23.0 versions? Please feel free to correct me here.), mirroring the existing pattern.CHECKLIST
---
Jira
Needs Doc) and QA (Needs QA)?Tests
compare/*-oc.yml)?Config/Logging/Testability