From 9b1bbd05bf9fd6d868827bad3b9a559ef5be589c Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Tue, 3 Nov 2026 23:19:44 +0100 Subject: [PATCH] ci(replace-wedding-standby): retry the database image pull on registry rate limits GHCR briefly answered toomanyrequests on the merge-group run for #5500, which failed the standby-replacement safety job although nothing was wrong. Retry the pull of the same pinned digest up to four times with backoff and fail only after the last attempt. Fixes #5514 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/replace-wedding-standby.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/replace-wedding-standby.yaml b/.github/workflows/replace-wedding-standby.yaml index fbd3377c18..ea2e1363c6 100644 --- a/.github/workflows/replace-wedding-standby.yaml +++ b/.github/workflows/replace-wedding-standby.yaml @@ -52,7 +52,20 @@ jobs: env: WEDDING_REPAIR_OPERAND_TEST: "true" run: | - docker pull ghcr.io/cloudnative-pg/postgresql@sha256:42708a75345b7a48fdd9257b071830783a97fd228529196b6313187a7198e185 + image=ghcr.io/cloudnative-pg/postgresql@sha256:42708a75345b7a48fdd9257b071830783a97fd228529196b6313187a7198e185 + # GHCR can answer `toomanyrequests` for a moment (#5514). Retry the pull of + # the same pinned digest with backoff and fail only after the last attempt. + attempts=4 + for attempt in $(seq 1 "$attempts"); do + if docker pull "$image"; then + break + fi + if [ "$attempt" -eq "$attempts" ]; then + echo "::error::docker pull failed after ${attempts} attempts" + exit 1 + fi + sleep $((attempt * 10)) + done go test -count=1 -timeout=1m -run '^TestLoopbackRequestReadsTheExporter$' ./scripts/replace-wedding-standby repair: