Bubble up image download failures

Currently, we're still returning 0 out of the upload_image method
despite the download failing. This changes behavior such that if the
image download fails, it returns an exit code of 1 to the caller to be
handled (or fail early) accordingly.

Change-Id: I901dc065b51946f363145ae888cca602946ceeea
This commit is contained in:
Jay Faulkner
2025-05-18 16:59:13 -07:00
parent c5d1a05281
commit 46e14fb1f7

View File

@@ -147,7 +147,8 @@ function upload_image {
if [[ $rc -ne 0 ]]; then
if [[ "$attempt" -eq "$max_attempts" ]]; then
echo "Not found: $image_url"
return
# Signal failure to download to the caller, so they can fail early
return 1
fi
echo "Download failed, retrying in $attempt second, attempt: $attempt"
sleep $attempt