From d17cb1b5fa3df76b6bea7e705ced848b3f040fdb Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 29 Oct 2024 05:39:23 -0600 Subject: [PATCH] prefetch: handle failed pulls Signed-off-by: Ed Santiago --- tests/helpers.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/helpers.bash b/tests/helpers.bash index a24fb3f25fc..1f381ee3581 100644 --- a/tests/helpers.bash +++ b/tests/helpers.bash @@ -206,6 +206,9 @@ function _prefetch_locksafe() { for attempt in $(seq 3) ; do if copy $COPY_REGISTRY_OPTS docker://"$img" dir:$_BUILDAH_IMAGE_CACHEDIR/$fname ; then break + else + # Failed. Clean up, so we don't leave incomplete remnants + rm -fr $_BUILDAH_IMAGE_CACHEDIR/$fname fi sleep 5 done