From 17aeae836fe18b1e21c723d6cdef5779b85153dc Mon Sep 17 00:00:00 2001 From: Jonas Juselius Date: Thu, 30 May 2024 10:54:09 +0200 Subject: [PATCH] fix: vcluster active wait for cluster to appear --- vcluster/create-vcluster.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vcluster/create-vcluster.sh b/vcluster/create-vcluster.sh index c5e8bf49..b08c8013 100755 --- a/vcluster/create-vcluster.sh +++ b/vcluster/create-vcluster.sh @@ -22,8 +22,18 @@ if [ $? = 0 ]; then $k get ns $ns >/dev/null 2>&1 || $k create ns $ns helm template -n $ns $@ $name ./chart | $k apply -f - - $k wait -n $ns --for=condition=ready pod -l app=vcluster + echo "waiting for vcluster $name to appear... " + while true; do + $k wait -n $ns --for=condition=ready pod -l app=vcluster 2>&1 > /dev/null + if [ $? != 0 ]; then + echo "zzz..." + sleep 15 + else + break + fi + done kubectl --context $name-vcluster -n dapr-system wait pod --for=condition=ready -l app=dapr-operator + echo "wating for Dapr..." sleep 15 kubectl kustomize ../resources/atlantis/manifests/staging | kubectl --context $name-vcluster apply -f- else