Skip to content

Commit 01feb36

Browse files
committed
fix(backups): wait for the platform redis strategy in the backup demo
The redis backup demo read cozy-default-redis once and gave up if it was absent. That strategy is rendered behind a lookup of the platform bucket, so it only exists after a Helm upgrade that runs once the bucket is provisioned. The backupstrategy-controller forces that upgrade, but helm-controller will not run it while a release in the chart's dependsOn is not Ready. A platform change shortly before the suite starts is enough to hold it back. The e2e install patches the platform package late (exposed services, then OIDC), the operator rewrites the cozystack-basics release, which then waits on its own dependencies, and backupstrategy-controller waits on cozystack-basics. On one run the strategy was still missing eight minutes after those patches, and the demo's single read failed the suite as if the backups stack were not installed. Wait for the object with a bound instead. 15 minutes covers the nine minutes seen between those patches and the strategy's creation on another run, and still leaves the demo inside its 30 minute step. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 294b969 commit 01feb36

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎examples/backups/redis/run-all.sh‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@ print_header "Step 00c: Create the Redis strategy + BackupClass"
113113
# Pod needs no package install at run time. Its presence also confirms the
114114
# platform default backups stack (backupstrategy-controller + CRDs) is
115115
# installed, without which the BackupJob below cannot reconcile at all.
116+
#
117+
# Wait for it rather than read it once. The strategy is rendered behind a
118+
# lookup of the platform bucket, so it exists only once a Helm upgrade has run
119+
# after that bucket was provisioned. The controller forces that upgrade, but
120+
# helm-controller holds it while any release in its dependsOn is not Ready, so
121+
# a platform change made just before this runs can keep it absent for minutes.
122+
# kubectl wait keeps polling through NotFound and fails on any other error.
123+
log_substep "Waiting for the platform's cozy-default-redis strategy..."
124+
kubectl wait --for=create redis.strategy.backups.cozystack.io/cozy-default-redis \
125+
--timeout=15m >/dev/null \
126+
|| { log_error "cozy-default-redis strategy did not appear: enable the platform default backups (backupstrategy-controller) before running this demo"; exit 1; }
116127
CLIENT_IMAGE=$(kubectl get redis.strategy.backups.cozystack.io cozy-default-redis \
117128
-o jsonpath='{.spec.template.spec.containers[?(@.name=="redis-backup")].image}')
118129
[[ -n "$CLIENT_IMAGE" ]] || { log_error "cozy-default-redis strategy has no redis-backup container image"; exit 1; }

0 commit comments

Comments
 (0)