diff --git a/.github/workflows/index-monitor.yml b/.github/workflows/index-monitor.yml index c49a1a1569fd36..e8c33127732147 100644 --- a/.github/workflows/index-monitor.yml +++ b/.github/workflows/index-monitor.yml @@ -24,11 +24,11 @@ jobs: id: integrity-check run: | status="fail" - consecutive_failures=0 + attempts=0 # We want to check for consistent failures # To do so, we will look for 3 consecutive failures with a 30 seconds wait # A single success is enough to pass - while [[ "${status}" != "ok" && $consecutive_failures -lt 3 ]]; do + while [[ "${status}" != "ok" && $attempts -lt 3 ]]; do # Check the index.yaml integrity REMOTE_MD5=($(curl -Ls http://charts.bitnami.com/bitnami/index.yaml | md5sum)) REPOSITORY_MD5=($(md5sum bitnami/index.yaml)) @@ -36,7 +36,7 @@ jobs: if [[ "${REPOSITORY_MD5[0]}" == "${REMOTE_MD5[0]}" ]]; then status='ok' else - consecutive_failures++ + attempts=$((attempts+1)) echo "Integrity check failed. Remote checksum '${REMOTE_MD5[0]}' does not match expected '${REPOSITORY_MD5[0]}'"; fi # Wait 30 seconds @@ -69,17 +69,21 @@ jobs: run: | repo="http://charts.bitnami.com/bitnami" status="fail" - consecutive_failures=0 + attempts=0 # We want to check for consistent failures # To do so, we will look for 3 consecutive failures with a 30 seconds wait # A single success is enough to pass - while [[ "${status}" != "ok" && $consecutive_failures -lt 3 ]]; do + while [[ "${status}" != "ok" && $attempts -lt 3 ]]; do # Validates the helm repository can be added and updated if helm repo add bitnami "${repo}" && helm repo update bitnami; then status="ok" else - consecutive_failures++ + attempts=$((attempts+1)) echo "Failed to pull charts from helm repository '${repo}'" + # If present, remove repository to allow retries + if helm repo list | grep -q bitnami; then + helm repo remove bitnami + fi fi # Wait 30 seconds sleep 30