Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 17f6f86

Browse files
committed
Merge pull request #8998 from wojtek-t/retry_downloading
Retry downloading tars in case of unpack failure
2 parents 567519c + 4fc3884 commit 17f6f86

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

cluster/gce/configure-vm.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -437,15 +437,22 @@ function download-release() {
437437
# store it when we download, and then when it's different infer that
438438
# a push occurred (otherwise it's a simple reboot).
439439

440-
echo "Downloading binary release tar ($SERVER_BINARY_TAR_URL)"
441-
download-or-bust "$SERVER_BINARY_TAR_URL"
442-
443-
echo "Downloading Salt tar ($SALT_TAR_URL)"
444-
download-or-bust "$SALT_TAR_URL"
445-
446-
echo "Unpacking Salt tree"
447-
rm -rf kubernetes
448-
tar xzf "${SALT_TAR_URL##*/}"
440+
# In case of failure of unpacking Salt tree (the last command in the
441+
# "until" block) retry downloading both release and Salt tars.
442+
until
443+
echo "Downloading binary release tar ($SERVER_BINARY_TAR_URL)"
444+
download-or-bust "$SERVER_BINARY_TAR_URL"
445+
446+
echo "Downloading Salt tar ($SALT_TAR_URL)"
447+
download-or-bust "$SALT_TAR_URL"
448+
449+
echo "Unpacking Salt tree"
450+
rm -rf kubernetes
451+
tar xzf "${SALT_TAR_URL##*/}"
452+
do
453+
sleep 15
454+
echo "Couldn't unpack Salt tree. Retrying..."
455+
done
449456

450457
echo "Running release install script"
451458
sudo kubernetes/saltbase/install.sh "${SERVER_BINARY_TAR_URL##*/}"

0 commit comments

Comments
 (0)