fix(mongodb-store): rename the init Job when its pod template changes #2381
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 263 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.334
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2381"
general
weight: 0.35
KaivalyaMDabhadkar
Summary
A Job's spec.template is immutable, but the create-mongodb-database Job name hashed only the init inputs. Changing mongodb.nodeSelector, tolerations, images or imagePullSecrets kept the old name, so helm upgrade and the Argo CD server-side diff failed with an immutable-field error.
Move the pod template into a named template and hash its rendered output together with oplogSizeMB. Existing installs get a new Job name once, so the init Job runs one more time. Every init step is idempotent.
Aligned all the mentions of the old
scriptHashto plainhashin docs and templates.Fixes #2378
Type of Change
Component(s) Affected
Testing
Checklist
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
MongoDB initialization Jobs are recreated when the oplog size, oplog shrink setting, or relevant pod configuration changes. Unrelated resource-limit changes do not change the Job name.
Job names account for rendered pod settings, including node selectors, tolerations, and image configuration.
Documentation
Updated MongoDB configuration guidance and runbooks to clarify Job naming and the changes that trigger a new initialization Job.
Clarified that switching MongoDB backends does not migrate data and may leave services connected to an empty database. Added guidance on redeploying and using backup and restore to preserve health events.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->