From e7e48d6a8b94abf76c2e926fa2d717d9c6b1c6c2 Mon Sep 17 00:00:00 2001 From: Fedor Dikarev Date: Wed, 22 Jan 2025 21:20:49 +0100 Subject: [PATCH] Also retry 408 Co-authored-by: Michael Bowyer Signed-off-by: Fedor Dikarev --- src/docker.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/docker.ts b/src/docker.ts index 632cd6a..fcefbb1 100644 --- a/src/docker.ts +++ b/src/docker.ts @@ -51,7 +51,12 @@ export async function loginStandard(registry: string, username: string, password }).then(res => { if (res.stderr.length > 0 && res.exitCode != 0) { let isRetriable: boolean - isRetriable = res.stderr.trim().endsWith("502 Bad Gateway") +function isRetriableError(stderr: string): boolean { + const trimmedError = stderr.trim(); + return trimmedError.endsWith("502 Bad Gateway") || trimmedError.includes("408"); +} + +isRetriable = isRetriableError(res.stderr); if (!isRetriable || (attempt >= attempts) { throw new Error(res.stderr.trim()); }