|
77 | 77 | @test "Create platform Package and reconcile previous version" { |
78 | 78 | # Minimal, version-stable platform config: networking + publishing only. These |
79 | 79 | # 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. |
84 | 84 | kubectl apply -f - <<EOF |
85 | 85 | apiVersion: cozystack.io/v1alpha1 |
86 | 86 | kind: Package |
@@ -128,14 +128,35 @@ EOF |
128 | 128 | } |
129 | 129 |
|
130 | 130 | @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. |
134 | 139 | 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}}' |
136 | 141 |
|
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 . |
139 | 160 | } |
140 | 161 |
|
141 | 162 | @test "Create isolated test tenant (baseline)" { |
|
0 commit comments