Skip to content

Commit e9aaee2

Browse files
committed
fix(mongodb-operator): apply CRD updates on upgrade via CreateReplace
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]>
1 parent 162a57d commit e9aaee2

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎packages/core/platform/sources/mongodb-operator.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ spec:
2121
install:
2222
namespace: cozy-mongodb-operator
2323
releaseName: mongodb-operator
24+
upgradeCRDs: CreateReplace
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
suite: mongodb-operator applies CRD updates on upgrade
2+
# psmdb-operator evolves its CRD schema between minor versions (1.21 -> 1.22 adds
3+
# storageScaling/storageAutoscaling, vault and other fields). Helm never upgrades
4+
# CRDs shipped in crds/, so the PackageSource must opt into CreateReplace; without
5+
# it the operator binary upgrades while the live CRD stays behind and the
6+
# apiserver rejects the new fields on existing clusters. Pin the policy so an
7+
# upgrade cannot silently regress.
8+
templates:
9+
- templates/sources.yaml
10+
release:
11+
name: cozystack
12+
namespace: cozy-system
13+
tests:
14+
- it: mongodb-operator PackageSource sets upgradeCRDs to CreateReplace
15+
documentSelector:
16+
path: metadata.name
17+
value: cozystack.mongodb-operator
18+
asserts:
19+
- equal:
20+
path: spec.variants[0].components[0].install.upgradeCRDs
21+
value: CreateReplace

0 commit comments

Comments
 (0)