Skip to content

Commit

Permalink
nodeup download should try all mirrors
Browse files Browse the repository at this point in the history
On an error, we were bailing out early!
  • Loading branch information
justinsb committed Aug 22, 2019
1 parent 54e2d9f commit 2462ab1
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 54 deletions.
4 changes: 2 additions & 2 deletions pkg/model/resources/nodeup.go
Expand Up @@ -84,12 +84,12 @@ download-or-bust() {
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down
4 changes: 2 additions & 2 deletions pkg/model/tests/data/bootstrapscript_0.txt
Expand Up @@ -73,12 +73,12 @@ download-or-bust() {
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions pkg/model/tests/data/bootstrapscript_1.txt
Expand Up @@ -73,12 +73,12 @@ download-or-bust() {
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions pkg/model/tests/data/bootstrapscript_2.txt
Expand Up @@ -73,12 +73,12 @@ download-or-bust() {
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions pkg/model/tests/data/bootstrapscript_3.txt
Expand Up @@ -73,12 +73,12 @@ download-or-bust() {
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions pkg/model/tests/data/bootstrapscript_4.txt
Expand Up @@ -73,12 +73,12 @@ download-or-bust() {
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions pkg/model/tests/data/bootstrapscript_5.txt
Expand Up @@ -73,12 +73,12 @@ download-or-bust() {
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi

Expand Down
Expand Up @@ -58,12 +58,12 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1bmastersadditionalcidrex
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down Expand Up @@ -337,12 +337,12 @@ Resources.AWSAutoScalingLaunchConfigurationnodesadditionalcidrexamplecom.Propert
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down
Expand Up @@ -67,12 +67,12 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersadditionaluserda
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down Expand Up @@ -366,12 +366,12 @@ Resources.AWSAutoScalingLaunchConfigurationnodesadditionaluserdataexamplecom.Pro
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down
Expand Up @@ -58,12 +58,12 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down Expand Up @@ -337,12 +337,12 @@ Resources.AWSAutoScalingLaunchConfigurationnodesminimalexamplecom.Properties.Use
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down
Expand Up @@ -53,12 +53,12 @@ download-or-bust() {
if [[ $(which curl) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
elif [[ $(which wget ) ]]; then
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
else
echo "== Could not find curl or wget. Retrying. =="
Expand Down
Expand Up @@ -53,12 +53,12 @@ download-or-bust() {
if [[ $(which curl) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
elif [[ $(which wget ) ]]; then
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
else
echo "== Could not find curl or wget. Retrying. =="
Expand Down
Expand Up @@ -58,12 +58,12 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersexternallbexampl
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down Expand Up @@ -357,12 +357,12 @@ Resources.AWSAutoScalingLaunchConfigurationnodesexternallbexamplecom.Properties.
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down
Expand Up @@ -58,12 +58,12 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down Expand Up @@ -337,12 +337,12 @@ Resources.AWSAutoScalingLaunchConfigurationnodesminimalexamplecom.Properties.Use
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down
Expand Up @@ -58,12 +58,12 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersmixedinstancesex
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down Expand Up @@ -358,12 +358,12 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1bmastersmixedinstancesex
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down Expand Up @@ -658,12 +658,12 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1cmastersmixedinstancesex
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down Expand Up @@ -958,12 +958,12 @@ Resources.AWSEC2LaunchTemplatenodesmixedinstancesexamplecom.Properties.LaunchTem
elif [[ $(curl --version) ]]; then
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
echo "== Failed to curl ${url}. Retrying. =="
break
continue
fi
else
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
echo "== Failed to wget ${url}. Retrying. =="
break
continue
fi
fi
Expand Down

0 comments on commit 2462ab1

Please sign in to comment.