From f7a52388b66079ae2487a2a1af4fe8d55549e1ee Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Mon, 23 Oct 2023 09:40:17 +0300 Subject: [PATCH] Test pre-submits --- pkg/model/resources/nodeup.go | 13 +++++++------ .../cloudup/awstasks/launchtemplate_target_api.go | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/model/resources/nodeup.go b/pkg/model/resources/nodeup.go index 8be0ccbe5ea0c..0ac2a197dbde5 100644 --- a/pkg/model/resources/nodeup.go +++ b/pkg/model/resources/nodeup.go @@ -64,6 +64,7 @@ function ensure-install-dir() { # Retry a download until we get it. args: name, sha, urls download-or-bust() { + echo "Downloading \"$1\" from \"$3\" with hash \"$2\"" local -r file="$1" local -r hash="$2" local -r urls=( $(split-commas "$3") ) @@ -79,10 +80,10 @@ download-or-bust() { while true; do for url in "${urls[@]}"; do commands=( - "curl -f --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" - "wget --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" - "curl -f -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" - "wget -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --compressed -Lo \"${file}\" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --compression=auto -O \"${file}\" --connect-timeout=20 --tries=6 --wait=10" + "curl -f -Lo \"${file}\" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget -O \"${file}\" --connect-timeout=20 --tries=6 --wait=10" ) for cmd in "${commands[@]}"; do echo "Attempting download with: ${cmd} {url}" @@ -110,7 +111,7 @@ validate-hash() { local -r expected="$2" local actual - actual=$(sha256sum ${file} | awk '{ print $1 }') || true + actual=$(sha256sum "${file}" | awk '{ print $1 }') || true if [[ "${actual}" != "${expected}" ]]; then echo "== ${file} corrupted, hash ${actual} doesn't match expected ${expected} ==" return 1 @@ -118,7 +119,7 @@ validate-hash() { } function split-commas() { - echo $1 | tr "," "\n" + echo "$1" | tr "," "\n" } function download-release() { diff --git a/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_api.go b/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_api.go index 0a2d8d7dd3645..df71c63781e63 100644 --- a/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_api.go +++ b/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_api.go @@ -125,6 +125,7 @@ func (t *LaunchTemplate) RenderAWS(c *awsup.AWSAPITarget, a, e, changes *LaunchT if err != nil { return fmt.Errorf("error rendering LaunchTemplate UserData: %v", err) } + klog.Infof("== USERDATA ==:\n%s", string(d)) data.UserData = aws.String(base64.StdEncoding.EncodeToString(d)) } // @step: add market options