Skip to content

Commit 11f9d90

Browse files
author
Sam Naser
committed
Use retries rather than sleeping to wait for CPR CRD existence
1 parent 8538e86 commit 11f9d90

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/asm/scripts/create_cpr.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ if [ "$#" -lt 3 ]; then
2121
exit 1
2222
fi
2323

24-
echo "Sleeping for CPR... do retries instead..."
25-
sleep 30
24+
# Wait for the CRD to get created before creating the CPR.
25+
readonly CPR_RESOURCE=controlplanerevisions.mesh.cloud.google.com
26+
for i in {1..6}; do kubectl get crd ${CPR_RESOURCE} && break || sleep 10; done
27+
kubectl wait --for condition=established --timeout=60s crd/${CPR_RESOURCE}
2628

2729
REVISION_NAME=$1; shift
2830
CHANNEL=$1; shift

0 commit comments

Comments
 (0)