From 0df99863f75fe8a8a2c79935004573d3cf2e9c15 Mon Sep 17 00:00:00 2001 From: Zakhar Kleyman Date: Fri, 13 Sep 2024 18:18:11 -0400 Subject: [PATCH] SERVER-94794 Add retries to container registry login command (#27065) GitOrigin-RevId: 2d768787bd3ca56d96568f3e5b3dab273797adc2 --- evergreen/container_registry_login.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/evergreen/container_registry_login.sh b/evergreen/container_registry_login.sh index 50988d0f540..746880bccf9 100644 --- a/evergreen/container_registry_login.sh +++ b/evergreen/container_registry_login.sh @@ -4,4 +4,11 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)" cd src set -oe -echo "${release_tools_container_registry_password}" | podman login --password-stdin --username ${release_tools_container_registry_username} ${release_tools_container_registry} +attempts=0 +max_attempts=4 + +while ! echo "${release_tools_container_registry_password}" | podman login --password-stdin --username ${release_tools_container_registry_username} ${release_tools_container_registry}; do + [ "$attempts" -ge "$max_attempts" ] && exit 1 + ((attempts++)) + sleep 10 +done