Repository navigation
chore(mongodb): bump psmdb-operator and CR to 1.22.0 - #2968
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the Percona Operator for MongoDB to version 1.22.0. The changes include re-vendoring the operator chart and bumping the managed CR version to maintain alignment with the latest upstream release. These updates are primarily focused on security improvements and ensuring the platform remains compatible with the latest operator features. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (13)
📝 Walkthrough
WalkthroughUpgrades the Percona Server MongoDB Operator from 1.21.1 to 1.22.0. Updates chart metadata, CR template, and test assertions. Adds ChangesMongoDB Operator 1.22.0 Upgrade
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Trivy (0.69.3)Trivy execution failed: 2026-06-22T16:13:38Z FATAL Fatal error run error: fs scan error: scan error: scan failed: failed analysis: post analysis error: post analysis error: kubernetes scan error: fs filter error: fs filter error: walk error range error: stat smartylint.json: no such file or directory: range error: stat smartylint.json: no such file or directory 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.
Code Review
This pull request updates the MongoDB application's crVersion from 1.21.1 to 1.22.0 in both the template configuration and the associated test assertions. I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Re-vendors the Percona Operator for MongoDB Helm chart from 1.21.2 to 1.22.0, moving the operator image to 1.22.0 and picking up the published security fixes. The CRD gains additive fields (native MinIO backup storage, storage scaling) and new metrics.k8s.io RBAC. The only schema removal -- the restore-spec `replset` string, replaced by `replsetRemapping` -- is unused by cozystack's mongodb app (restore.yaml uses clusterName/pitr/backupSource only). Deprecations (PSMDB 6.0, PMM2, enableVolumeExpansion) stay backward-compatible; the watchAllNamespaces override remains valid. Note: Helm v3 does not update CRDs on `helm upgrade`; the bumped CRD must be applied manually on existing clusters per Percona's upgrade docs. Adaptations: - charts/: re-vendored via `make update` (helm pull psmdb-operator 1.22.0) Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
Matches the managed MongoDB CR (`spec.crVersion`) to the psmdb-operator 1.22.0 bump so the platform tracks the deployed operator instead of running at the N-1 skew. The 1.22.0 CR schema is additive (no new required fields), so existing instances reconcile cleanly under SmartUpdate. PMM (disabled by default) and the PBM 2.11.0 sidecar stay compatible with operator 1.22.0; refreshing their image matrix is a separate apps/mongodb concern. Adaptations: - templates/mongodb.yaml: spec.crVersion 1.21.1 -> 1.22.0 - tests/mongodb_test.yaml: update crVersion assertion to 1.22.0 Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
psmdb-operator evolves its CRD schema between minor versions; 1.22.0 adds spec.storageScaling/storageAutoscaling, vault and other fields. Helm never upgrades CRDs shipped in crds/, so without an explicit policy the operator binary upgrades on an existing cluster while the live CRD stays behind and the apiserver rejects the new fields. Opt the mongodb-operator PackageSource into CreateReplace, consistent with etcd-operator, and add a platform test pinning the policy. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
ebc9b99 to
e9aaee2
Compare
myasnikovdaniil
left a comment
There was a problem hiding this comment.
APPROVE — clean, well-scoped operator+CR bump. The CRD regeneration is additive-safe and the upgrade path is handled correctly.
Verified the migration-safety angle (the main risk here):
- The +808-line CRD diff is additive. The only schema removal is
replset→replsetRemappingin the Restore CRD, which cozystack'srestore.yamlnever sets (it uses onlyclusterName/pitr/backupSource), and Restore CRs are one-shot/ephemeral — so no live cozystack-managed object is invalidated by the CreateReplace. - The two new constraints on the pre-existing
startingDeadlineSeconds(default: 120,minimum: 1) don't re-validate already-stored objects, so existing CRs aren't rejected on upgrade. - Good call wiring
upgradeCRDs: CreateReplaceinto the PackageSource (consistent withetcd-operator) plus a unittest to pin it — that's the right fix for "Helm v3 doesn't upgrade CRDs", and it makes the upgrade self-applying.
dev10 verification (k8s 1.35.4): server-side-applied the new CRD (clean), upgraded the operator to 1.22.0 (starts clean, acquires leadership, all controllers up), deployed a managed MongoDB at crVersion 1.22.0 → reached ready (mongoVersion 8.0.17-6), and a connect + write + read-back succeeded with a healthy single-member replica set. Local helm unittest: 94/94 (app) and 60/60 (platform, incl. the new CRD-policy test).
Re-vendoring hygiene: clean upstream pull (the update target re-pulls from scratch, no local patches), the only cozystack override is watchAllNamespaces: true, and the new metrics.k8s.io RBAC is gated on watch-namespace so it correctly activates under our config. App values.yaml/schema/README untouched — no regen needed.
Two non-blocking nits inline. The branch also just needs a rebase past the v1.5.0 release commits to clear BLOCKED.
| install: | ||
| namespace: cozy-mongodb-operator | ||
| releaseName: mongodb-operator | ||
| upgradeCRDs: CreateReplace |
There was a problem hiding this comment.
nit: This upgradeCRDs: CreateReplace actually automates the CRD upgrade on helm upgrade, but the PR description's "Upgrade note" still says the 1.22.0 CRD "must be applied manually (kubectl apply --server-side)". The body undersells the fix — worth updating it so operators don't think a manual step is still required after this merges. (Verified on dev10: server-side apply of the new CRD is clean, and CreateReplace maps to HelmRelease.Spec.Upgrade.CRDs.)
| rule: self.type != 'latest' || !has(self.date) | ||
| replset: | ||
| type: string | ||
| replsetRemapping: |
There was a problem hiding this comment.
nit (non-blocking): This replset → replsetRemapping rename is the single schema removal in the diff, and it lands on the Restore CRD which CreateReplace will force-replace. The PackageSource doc itself warns CreateReplace "may cause data loss if upstream drops fields from a CRD with live objects." Confirmed safe for cozystack — apps/mongodb/templates/restore.yaml only sets clusterName/pitr/backupSource, and Restore CRs are one-shot — but a customer who hand-authored a Restore CR with replset set would have that value pruned on upgrade. Flagging for the record; no change needed.
What this PR does
Bumps the Percona Operator for MongoDB stack from 1.21.x to 1.22.0 (latest upstream release), picking up the published security fixes in the operator image that the issue enumerates.
Two coupled changes:
system/mongodb-operator: re-vendors the upstream psmdb-operator chart 1.21.2 → 1.22.0 viamake update(operator image →percona/percona-server-mongodb-operator:1.22.0). The vendored tree is byte-for-byte identical to a fresh upstream pull.apps/mongodb: bumps the managed CRspec.crVersion1.21.1 → 1.22.0 so the platform tracks the deployed operator instead of running at the N-1 skew, plus the matching helm-unittest assertion.The 1.22.0 CRD diff is additive (native MinIO backup storage, storage scaling,
hookScript,PBMReadycondition, newmetrics.k8s.ioRBAC that activates under ourwatchAllNamespaces: true). The only schema removal — the restore-specreplsetstring, renamed upstream toreplsetRemapping— is unused by the cozystack mongodb app (restore template usesclusterName/pitr/backupSourceonly). Deprecations (PSMDB 6.0, PMM2,enableVolumeExpansion) stay backward-compatible. The PBM (2.11.0) and PMM (2.44.1, disabled by default) sidecars stay compatible with 1.22.0 and are out of scope here.Verified:
helm unittest packages/apps/mongodb94/94 pass;helm templaterenders the operator with the new image.Upgrade note: Helm v3 does not update CRDs on
helm upgrade. On existing clusters the 1.22.0 CRD must be applied manually (kubectl apply --server-side -f .../crds/crd.yaml); the operator pod itself runs fine against the older CRD until then.Closes #2888
Release note
Summary by CodeRabbit
Release Notes
New Features
Chores
Documentation