Skip to content

Commit

Permalink
Fix the loop for pulling images
Browse files Browse the repository at this point in the history
When starting with loop=0, ((loop++)) actually returns 0, which is interpretted as false and thus the loop does not happen.
  • Loading branch information
hhorak committed Aug 5, 2020
1 parent 1a1680c commit 57d2c55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function pull_image {
# Try pulling the image to see if it is accessible
# WORKAROUND: Since Fedora registry sometimes fails randomly, let's try it more times
while ! docker pull "$image_name"; do
((loop++))
((loop++)) || :
echo "Pulling image $image_name failed."
[ "$loop" -gt "$loops" ] && { echo "It happened $loops times. Giving up." ; return 1; }
echo "Let's wait $((loop*5)) seconds and try again."
Expand Down

0 comments on commit 57d2c55

Please sign in to comment.