From 27cd48bf96b0b2895cadec42a29db897c84468e2 Mon Sep 17 00:00:00 2001 From: vsoch Date: Sat, 18 Jan 2025 17:14:20 -0700 Subject: [PATCH] wait for webhook to be ready Signed-off-by: vsoch --- .github/test.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/test.sh b/.github/test.sh index 8fab0f5..029af99 100755 --- a/.github/test.sh +++ b/.github/test.sh @@ -20,7 +20,6 @@ echo "Found fluxqueue scheduler pod: ${scheduler_pod}" postgres_pod=$(kubectl get pods -n ${namespace} -o json | jq -r .items[2].metadata.name) echo "Found fluxqueue postgres pod: ${postgres_pod}" - # Wait for fluxion to pull (largest container) while true do @@ -65,9 +64,18 @@ function check_output { fi } -# Now create the pod and job -echo_run kubectl apply -f ./examples/pod.yaml -sleep 3 +# Wait for webhook to be ready and submit the pod +while true + do + echo_run kubectl apply -f ./examples/pod.yaml + retval=$? + if [[ "${retval}" == "0" ]]; then + echo "Webhook for ${controller_pod} is ready" + break + fi + sleep 10 +done + echo_run kubectl get pods # The pod should be running, and scheduler should be fluxion