From 682766f679077b7a3884f60aa1b6b80ad71570d5 Mon Sep 17 00:00:00 2001 From: Max! Date: Fri, 10 Nov 2023 11:13:58 +0100 Subject: [PATCH] adding a possible fix from cnpgs own ci steps --- .github/workflows/ci-helm-lint-test.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci-helm-lint-test.yml b/.github/workflows/ci-helm-lint-test.yml index 83f2e4f..6ec6c86 100644 --- a/.github/workflows/ci-helm-lint-test.yml +++ b/.github/workflows/ci-helm-lint-test.yml @@ -116,6 +116,21 @@ jobs: #helm install cnpg-cluster cnpg-cluster/cnpg-cluster --values test-values.yaml helm template . -f test-values.yaml > deploy.yaml kubectl apply -f deploy.yaml + + ITER=0 + while true; do + if [[ $ITER -ge 300 ]]; then + echo "Cluster not ready" + exit 1 + fi + READY_INSTANCES=$(kubectl get cluster cluster-example -o jsonpath='{.status.readyInstances}') + if [[ "$READY_INSTANCES" == 3 ]]; then + echo "Cluster up and running" + break + fi + sleep 1 + (( ++ITER )) + done - name: Run chart-testing (install) id: install