From 2462ab1c02974e79120ba4bd5be17a284c5511dc Mon Sep 17 00:00:00 2001 From: Justin SB Date: Thu, 22 Aug 2019 00:20:40 -0400 Subject: [PATCH] nodeup download should try all mirrors On an error, we were bailing out early! --- pkg/model/resources/nodeup.go | 4 ++-- pkg/model/tests/data/bootstrapscript_0.txt | 4 ++-- pkg/model/tests/data/bootstrapscript_1.txt | 4 ++-- pkg/model/tests/data/bootstrapscript_2.txt | 4 ++-- pkg/model/tests/data/bootstrapscript_3.txt | 4 ++-- pkg/model/tests/data/bootstrapscript_4.txt | 4 ++-- pkg/model/tests/data/bootstrapscript_5.txt | 4 ++-- .../cloudformation.json.extracted.yaml | 8 ++++---- .../cloudformation.json.extracted.yaml | 8 ++++---- .../cloudformation.json.extracted.yaml | 8 ++++---- ...a.masters.k8s-iam.us-west-2.td.priv_user_data | 4 ++-- ...ion_nodes.k8s-iam.us-west-2.td.priv_user_data | 4 ++-- .../cloudformation.json.extracted.yaml | 8 ++++---- .../cloudformation.json.extracted.yaml | 8 ++++---- .../cloudformation.json.extracted.yaml | 16 ++++++++-------- .../cloudformation.json.extracted.yaml | 16 ++++++++-------- 16 files changed, 54 insertions(+), 54 deletions(-) diff --git a/pkg/model/resources/nodeup.go b/pkg/model/resources/nodeup.go index 220caa0f990a8..b96a803ca374c 100644 --- a/pkg/model/resources/nodeup.go +++ b/pkg/model/resources/nodeup.go @@ -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 diff --git a/pkg/model/tests/data/bootstrapscript_0.txt b/pkg/model/tests/data/bootstrapscript_0.txt index 4180abec73f28..d7f4335276077 100644 --- a/pkg/model/tests/data/bootstrapscript_0.txt +++ b/pkg/model/tests/data/bootstrapscript_0.txt @@ -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 diff --git a/pkg/model/tests/data/bootstrapscript_1.txt b/pkg/model/tests/data/bootstrapscript_1.txt index ba6d30087ac91..a39427fbb86c7 100644 --- a/pkg/model/tests/data/bootstrapscript_1.txt +++ b/pkg/model/tests/data/bootstrapscript_1.txt @@ -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 diff --git a/pkg/model/tests/data/bootstrapscript_2.txt b/pkg/model/tests/data/bootstrapscript_2.txt index ba6d30087ac91..a39427fbb86c7 100644 --- a/pkg/model/tests/data/bootstrapscript_2.txt +++ b/pkg/model/tests/data/bootstrapscript_2.txt @@ -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 diff --git a/pkg/model/tests/data/bootstrapscript_3.txt b/pkg/model/tests/data/bootstrapscript_3.txt index a7f0afb42d9ea..ce0c6142285e5 100644 --- a/pkg/model/tests/data/bootstrapscript_3.txt +++ b/pkg/model/tests/data/bootstrapscript_3.txt @@ -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 diff --git a/pkg/model/tests/data/bootstrapscript_4.txt b/pkg/model/tests/data/bootstrapscript_4.txt index 321560977b160..a9f77dbd11ef2 100644 --- a/pkg/model/tests/data/bootstrapscript_4.txt +++ b/pkg/model/tests/data/bootstrapscript_4.txt @@ -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 diff --git a/pkg/model/tests/data/bootstrapscript_5.txt b/pkg/model/tests/data/bootstrapscript_5.txt index 321560977b160..a9f77dbd11ef2 100644 --- a/pkg/model/tests/data/bootstrapscript_5.txt +++ b/pkg/model/tests/data/bootstrapscript_5.txt @@ -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 diff --git a/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml index 9b088d27dd295..a0546d921bee4 100644 --- a/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml @@ -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 @@ -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 diff --git a/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml index b927c30744a10..b05511a74c042 100644 --- a/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml @@ -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 @@ -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 diff --git a/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml index d51e63c06f450..27c34d66845fe 100644 --- a/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml @@ -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 @@ -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 diff --git a/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_master-us-west-2a.masters.k8s-iam.us-west-2.td.priv_user_data b/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_master-us-west-2a.masters.k8s-iam.us-west-2.td.priv_user_data index 7972495cf488c..aa56fb1cf3711 100644 --- a/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_master-us-west-2a.masters.k8s-iam.us-west-2.td.priv_user_data +++ b/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_master-us-west-2a.masters.k8s-iam.us-west-2.td.priv_user_data @@ -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. ==" diff --git a/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_nodes.k8s-iam.us-west-2.td.priv_user_data b/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_nodes.k8s-iam.us-west-2.td.priv_user_data index 9e1251aaa97ca..e1ccc2e51a05f 100644 --- a/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_nodes.k8s-iam.us-west-2.td.priv_user_data +++ b/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_nodes.k8s-iam.us-west-2.td.priv_user_data @@ -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. ==" diff --git a/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml index aa708175f7dfa..219409fc3902a 100644 --- a/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml @@ -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 @@ -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 diff --git a/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml index d51e63c06f450..27c34d66845fe 100644 --- a/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml @@ -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 @@ -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 diff --git a/tests/integration/update_cluster/mixed_instances/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/mixed_instances/cloudformation.json.extracted.yaml index bb46a9c356f06..08c327d960f93 100644 --- a/tests/integration/update_cluster/mixed_instances/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/mixed_instances/cloudformation.json.extracted.yaml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json.extracted.yaml index bb46a9c356f06..08c327d960f93 100644 --- a/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json.extracted.yaml @@ -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 @@ -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 @@ -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 @@ -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