Skip to content

Commit 8e96a3e

Browse files
committed
fix(foundationdb): apply foundationdb-operator CRD updates on upgrade
The foundationdb-operator PackageSource sets no upgradeCRDs policy, so a cluster installed before v1.6.0 runs the v2.30.0 operator on the v2.13.0 CRDs it first installed. The apiserver prunes every field added since, status.backupDetails.restorable on FoundationDBBackup among them, so a backup never shows as restorable however long it has run. The v2.30.0 CRDs only add fields. They keep the single v1beta2 version and drop or retype nothing, and the one new constraint, a pattern on perpetual_storage_wiggle_locality, sits on a field the platform does not set, so CreateReplace is safe. Nothing in the foundationdb-operator package changes here, so a cluster picks the new CRDs up at the next upgrade of that release, which comes with the next change to the package. Assisted-by: LLM Signed-off-by: Yan Bondarenko <[email protected]>
1 parent b74029c commit 8e96a3e

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ spec:
2020
install:
2121
namespace: cozy-foundationdb-operator
2222
releaseName: foundationdb-operator
23+
# helm-controller leaves existing CRDs alone on upgrade, so a cluster
24+
# installed before v1.6.0 keeps the v2.13.0 schema under the v2.30.0
25+
# operator, and the apiserver prunes the fields added since,
26+
# status.backupDetails.restorable among them. The schema diff adds
27+
# fields and drops none, so replace is safe.
28+
upgradeCRDs: CreateReplace
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
suite: foundationdb-operator applies CRD updates on upgrade
2+
# The fdb-operator v2.30.0 CRDs add fields the v2.13.0 ones lack, among them
3+
# status.backupDetails.restorable on FoundationDBBackup. Helm never upgrades
4+
# CRDs shipped in crds/, so without CreateReplace a cluster installed before
5+
# v1.6.0 keeps the v2.13.0 CRDs and the apiserver prunes those fields on every
6+
# write. Pin the policy so an upgrade cannot silently regress.
7+
templates:
8+
- templates/sources.yaml
9+
release:
10+
name: cozystack
11+
namespace: cozy-system
12+
tests:
13+
- it: foundationdb-operator PackageSource sets upgradeCRDs to CreateReplace
14+
documentSelector:
15+
path: metadata.name
16+
value: cozystack.foundationdb-operator
17+
asserts:
18+
- equal:
19+
path: spec.variants[0].components[0].install.upgradeCRDs
20+
value: CreateReplace

0 commit comments

Comments
 (0)