Skip to content

Commit a14cff5

Browse files
test(e2e): enable seaweedfs baseline so etcd-adoption migration can snapshot
The first CI run of the upgrade lane correctly caught a real failure: the 1.5.3->current platform upgrade's pre-upgrade migration hook failed at migration 50 (etcd v1alpha2 adoption), which refuses to adopt a live etcd without a pre-adoption S3 safety snapshot. The baseline enabled root etcd but disabled seaweedfs, so the backupstrategy-controller's cozy-backups Bucket never bound and the cozy-backups-creds Secret it projects into cozy-velero — the migration's only required backup target — never appeared. Enable seaweedfs on the root tenant (verified: v1.5.3 already ships backupstrategy-controller + velero as default packages and projects cozy-backups-creds into cozy-velero, matching the current migration's lookup), and gate the baseline on that Secret existing before the upgrade so the pre-upgrade hook can resolve the snapshot target and adopt etcd for real. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent 2cb1845 commit a14cff5

1 file changed

Lines changed: 31 additions & 10 deletions

File tree

‎hack/e2e-upgrade-install-previous.bats‎

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@
7777
@test "Create platform Package and reconcile previous version" {
7878
# Minimal, version-stable platform config: networking + publishing only. These
7979
# keys have been valid since the 1.4 line, so the same manifest installs on the
80-
# baseline AND is what the current chart re-renders on upgrade. Deliberately
81-
# lean (no monitoring/seaweedfs bundle) — the seeded canaries don't need them,
82-
# and a leaner baseline is faster and less flaky while still exercising the
83-
# operators/CRDs/storage/tenant/app upgrade surface.
80+
# baseline AND is what the current chart re-renders on upgrade. Monitoring is
81+
# left off (the seeded canaries don't need it); object storage is NOT — it is
82+
# enabled at the root-tenant level below (seaweedfs), because the etcd
83+
# v1alpha2 adoption migration needs the backup target it provides.
8484
kubectl apply -f - <<EOF
8585
apiVersion: cozystack.io/v1alpha1
8686
kind: Package
@@ -128,14 +128,35 @@ EOF
128128
}
129129

130130
@test "Configure root tenant (baseline)" {
131-
# Enable just enough of the root tenant to host a child tenant + apps: etcd
132-
# (tenant control plane) and ingress. Monitoring/seaweedfs are intentionally
133-
# left off (see the lean-baseline rationale above).
131+
# Enable etcd (a legacy etcd.aenix.io cluster for the v1alpha2 adoption
132+
# migration to exercise), ingress, and seaweedfs. seaweedfs is REQUIRED here,
133+
# not optional: migration 50 (etcd v1alpha2 adoption, run during the upgrade)
134+
# refuses to adopt live etcd without a pre-adoption S3 safety snapshot, and the
135+
# backupstrategy-controller only projects the cozy-backups-creds Secret it needs
136+
# once the cozy-backups Bucket binds against tenant-root's object store. Without
137+
# seaweedfs the bucket never binds, the creds never project, and the upgrade's
138+
# pre-upgrade migration hook fails BackoffLimitExceeded.
134139
kubectl patch tenants/root -n tenant-root --type merge \
135-
-p '{"spec":{"host":"example.org","ingress":true,"etcd":true,"isolated":true}}'
140+
-p '{"spec":{"host":"example.org","ingress":true,"etcd":true,"isolated":true,"seaweedfs":true}}'
136141

137-
timeout 60 sh -ec 'until kubectl get hr -n tenant-root etcd ingress tenant-root >/dev/null 2>&1; do sleep 1; done'
138-
kubectl wait hr/etcd hr/ingress hr/tenant-root -n tenant-root --timeout=10m --for=condition=ready
142+
timeout 60 sh -ec 'until kubectl get hr -n tenant-root etcd ingress seaweedfs tenant-root >/dev/null 2>&1; do sleep 1; done'
143+
# seaweedfs installs as a serial chain (seaweedfs-db CNPG -> seaweedfs-system
144+
# raft -> seaweedfs wrapper), ~5-6min idle and longer under load; the
145+
# tenant-root parent flips Ready only after every child, so gate at 20m.
146+
kubectl wait hr/etcd hr/ingress hr/seaweedfs hr/tenant-root -n tenant-root --timeout=20m --for=condition=ready
147+
}
148+
149+
@test "Wait for platform backup target (etcd-adoption prerequisite)" {
150+
# The etcd v1alpha2 adoption migration's only hard boundary is the
151+
# backupstrategy-controller-projected cozy-backups-creds Secret (AWS creds) in
152+
# cozy-velero — see packages/core/platform/images/migrations/migrations/50
153+
# ("The real boundary is the credentials Secret, not the path"). Gate on it
154+
# here so the pre-upgrade hook in Phase 3 can resolve the snapshot target.
155+
# 10m: the projection chains cozy-backups Bucket bind -> COSI access grant ->
156+
# projector copy into cozy-velero, all downstream of the seaweedfs wait above.
157+
timeout 600 sh -ec 'until kubectl -n cozy-velero get secret cozy-backups-creds >/dev/null 2>&1; do sleep 5; done'
158+
kubectl -n cozy-velero get secret cozy-backups-creds \
159+
-o jsonpath='{.data.AWS_ACCESS_KEY_ID}' | grep -q .
139160
}
140161

141162
@test "Create isolated test tenant (baseline)" {

0 commit comments

Comments
 (0)