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 <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 8e96a3e9b7)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
This commit is contained in:
Yan Bondarenko authored and Myasnikov Daniil committed 2026-11-25 09:58:08 +00:00
1 parent 3a342b1e5f
commit cc99f7f7ed
2 files changed
+26

No files matched your search

@@ -20,3 +20,9 @@ spec:
install:
namespace: cozy-foundationdb-operator
releaseName: foundationdb-operator
# helm-controller leaves existing CRDs alone on upgrade, so a cluster
# installed before v1.6.0 keeps the v2.13.0 schema under the v2.30.0
# operator, and the apiserver prunes the fields added since,
# status.backupDetails.restorable among them. The schema diff adds
# fields and drops none, so replace is safe.
upgradeCRDs: CreateReplace
@@ -0,0 +1,20 @@
suite: foundationdb-operator applies CRD updates on upgrade
# The fdb-operator v2.30.0 CRDs add fields the v2.13.0 ones lack, among them
# status.backupDetails.restorable on FoundationDBBackup. Helm never upgrades
# CRDs shipped in crds/, so without CreateReplace a cluster installed before
# v1.6.0 keeps the v2.13.0 CRDs and the apiserver prunes those fields on every
# write. Pin the policy so an upgrade cannot silently regress.
templates:
- templates/sources.yaml
release:
name: cozystack
namespace: cozy-system
tests:
- it: foundationdb-operator PackageSource sets upgradeCRDs to CreateReplace
documentSelector:
path: metadata.name
value: cozystack.foundationdb-operator
asserts:
- equal:
path: spec.variants[0].components[0].install.upgradeCRDs
value: CreateReplace