fix(helm): make mongo init-container -ubi8 append idempotent - #41936
Conversation
The chart derives two image references from the single `mongodbCommunity.version` value, and on a private registry (a mirror that only carries `-ubi8` tags) they need contradictory formats: - The MongoDBCommunity CR `spec.version` is consumed verbatim by the operator, which only auto-appends `-ubi8` for MongoDB's official registry URLs. On a private mirror the CR must carry `8.0.20-ubi8`. - The init-container wait image helper always appended `-ubi8`, so a `8.0.20-ubi8` value produced `...:8.0.20-ubi8-ubi8`, which fails. Net: no single value worked on a private registry, forcing users to set `version: "8.0.20-ubi8"` AND separately override `initContainer.mongodb.image` and keep both in sync on every bump. Make `appsmith.mongoInitContainerImage` trim a trailing `-ubi8` before re-appending it, so the append is idempotent: both `8.0.20` and `8.0.20-ubi8` render `...:8.0.20-ubi8`. Private-registry users can now drive both consumers from `version` alone. The suffix is defined once ($suffix) so trim and append can't drift. The default path is unchanged (`8.0.20` still renders `...:8.0.20-ubi8`). Docs and a helm-unittest case cover the private-registry scenario. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
WalkthroughThe Helm helper for the MongoDB Community init-container image now trims an existing ChangesMongo init container image suffix fix
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
deploy/helm/values.yaml (1)
507-511: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRegenerate README after doc comment update.
New extended description added above
mongodbCommunity.version. Confirmhelm-docs --sort-values-order filewas run so the README reflects this text.As per coding guidelines, "When editing
values.yaml, regenerate both the JSON schema and README before committing usinghelm schemaandhelm-docs --sort-values-order filecommands."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deploy/helm/values.yaml` around lines 507 - 511, The doc comment for mongodbCommunity.version in values.yaml was updated, so regenerate the README and JSON schema to keep generated docs in sync. Run the helm-docs --sort-values-order file workflow and the helm schema generation step after the change, then verify the README reflects the new extended description and the values schema matches the updated comment.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@deploy/helm/values.yaml`:
- Around line 507-511: The doc comment for mongodbCommunity.version in
values.yaml was updated, so regenerate the README and JSON schema to keep
generated docs in sync. Run the helm-docs --sort-values-order file workflow and
the helm schema generation step after the change, then verify the README
reflects the new extended description and the values schema matches the updated
comment.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 667aab5e-c6a0-4041-b188-6576c07379ef
📒 Files selected for processing (3)
deploy/helm/templates/_helpers.tpldeploy/helm/tests/mongodb_operator_test.yamldeploy/helm/values.yaml
Description
Tip
TL;DR — On a private registry that only mirrors MongoDB's
-ubi8tags, there was no single value ofmongodbCommunity.versionthat worked, because the chart feeds it to two consumers with contradictory suffix expectations. This makes the init-container image helper's-ubi8append idempotent so one value drives both. Helm-chart-only change; default behavior is byte-identical.The chart derives two image references from the single
mongodbCommunity.versionvalue, and on a private registry (a mirror that only carries-ubi8tags) the two consumers demand contradictory formats:spec.version(deploy/helm/templates/mongodb-community.yaml) — consumed verbatim by the MongoDB Community Operator. The operator only auto-appends-ubi8for MongoDB's official registry URLs; for a private mirror it uses the value as-is, so the CR must carry8.0.20-ubi8ormongodcan't pull.appsmith.mongoInitContainerImagehelper (deploy/helm/templates/_helpers.tpl) — always appended-ubi8, so a8.0.20-ubi8value produced...:8.0.20-ubi8-ubi8, which fails.Net: with a single bare value there was no correct setting on a private registry. The only workaround was to set
version: "8.0.20-ubi8"and separately overrideinitContainer.mongodb.imageto the full path — two knobs kept in sync on every version bump.What changed
Make the helper strip a trailing
-ubi8before re-appending it, so the append is idempotent — both8.0.20and8.0.20-ubi8render...:8.0.20-ubi8. The suffix is now defined once ($suffix) and used for both the trim and the append, so they can't drift if it ever changes. Private-registry users can now drive both consumers fromversionalone; theinitContainer.mongodb.imageoverride is no longer needed.versionvaluespec.version8.0.208.0.20(operator appends-ubi8)…:8.0.20-ubi88.0.20-ubi88.0.20-ubi8(verbatim)…:8.0.20-ubi8(trimmed, not-ubi8-ubi8)The operator-side behavior (auto-append only for official URLs) is a MongoDB limitation outside Appsmith's control; this fixes only the chart-helper side. The default path is byte-identical (
8.0.20still renders…:8.0.20-ubi8), so existing snapshots are unaffected.Files:
deploy/helm/templates/_helpers.tpl(idempotent trim + doc),deploy/helm/values.yaml(private-registry guidance),deploy/helm/tests/mongodb_operator_test.yaml(2 new unittest cases).Testing:
helm unittest deploy/helm→ 69 passed, 7 snapshots, 0 failed. Verified renders:8.0.20→…:8.0.20-ubi8;8.0.20-ubi8→ init…:8.0.20-ubi8(no double suffix) and CRspec.version: "8.0.20-ubi8".Fixes #41937
Automation
/ok-to-test tags=""
🔍 Cypress test results
Warning
Tests have not run on the HEAD 8fa87fc yet
Mon, 06 Jul 2026 18:38:07 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
-ubi8suffix are no longer duplicated.Documentation
-ubi8tags.Tests
-ubi8is already present.