From 78c5dda5e09110df941d90750850fa9e77be4b28 Mon Sep 17 00:00:00 2001 From: Johannes Kleinlercher Date: Fri, 3 May 2024 18:13:47 +0200 Subject: [PATCH] wait longer and exit if apps are not synced and healthy at the end Signed-off-by: Johannes Kleinlercher --- install-k3d-cluster.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/install-k3d-cluster.sh b/install-k3d-cluster.sh index ee5477687..7e1c12976 100644 --- a/install-k3d-cluster.sh +++ b/install-k3d-cluster.sh @@ -51,11 +51,11 @@ kubectl apply -f https://raw.githubusercontent.com/suxess-it/sx-cnp-oss/main/boo # max wait for 10 minutes -end=$((SECONDS+600)) +end=$((SECONDS+1200)) argocd_apps="argocd sx-loki sx-kubecost sx-keycloak sx-promtail sx-tempo sx-crossplane sx-bootstrap-app sx-kargo approved-application-team-app sx-cert-manager sx-argo-rollouts sx-external-secrets sx-kyverno sx-kube-prometheus-stack" +all_apps_synced="true" while [ $SECONDS -lt $end ]; do - all_apps_synced="true" for app in ${argocd_apps} ; do kubectl get application -n argocd ${app} | grep "Synced.*Healthy" exit_code=$? @@ -70,5 +70,9 @@ while [ $SECONDS -lt $end ]; do kubectl get application -n argocd sleep 10 done +if [ ${all_apps_synced} != "true" ] ; then + echo "not all apps synced and healthy after 1200 seconds" + exit 1 +fi echo "app 'sx-backstage' is not checked because there we need to manually apply secrets"