fix(e2e): poll for CRD existence before waiting for Established condition
kubectl wait fails immediately with NotFound if the CRD does not exist yet. The operator creates CRDs asynchronously on startup, so wrap the wait in a retry loop that tolerates the initial absence. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
parent
4843a617bc
commit
4e5455c72c
1 changed files with 4 additions and 3 deletions
|
|
@ -19,9 +19,10 @@
|
|||
# Verify the operator deployment is available
|
||||
kubectl wait deployment/cozystack-operator -n cozy-system --timeout=1m --for=condition=Available
|
||||
|
||||
# Wait for operator to install CRDs (happens at startup before reconcile loop)
|
||||
kubectl wait crd/packages.cozystack.io --for=condition=Established --timeout=2m
|
||||
kubectl wait crd/packagesources.cozystack.io --for=condition=Established --timeout=2m
|
||||
# Wait for operator to install CRDs (happens at startup before reconcile loop).
|
||||
# kubectl wait fails immediately if the CRD does not exist yet, so poll until it appears first.
|
||||
timeout 120 sh -ec 'until kubectl wait crd/packages.cozystack.io --for=condition=Established --timeout=10s 2>/dev/null; do sleep 2; done'
|
||||
timeout 120 sh -ec 'until kubectl wait crd/packagesources.cozystack.io --for=condition=Established --timeout=10s 2>/dev/null; do sleep 2; done'
|
||||
|
||||
# Wait for operator to create the platform PackageSource
|
||||
timeout 120 sh -ec 'until kubectl get packagesource cozystack.cozystack-platform >/dev/null 2>&1; do sleep 2; done'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue