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:
@@ -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
|
||||
|
Reference in New Issue
Block a user