From b8a8e179d5046209e567f161377051790a6bcda4 Mon Sep 17 00:00:00 2001 From: Vineeth Bandi Date: Wed, 17 Jul 2024 10:21:55 -0500 Subject: [PATCH] updated check_upstream_golang.sh to properly set empty variables --- builder-base/scripts/check_upstream_golang.sh | 2 +- eks-distro-base/scripts/check_upstream_golang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder-base/scripts/check_upstream_golang.sh b/builder-base/scripts/check_upstream_golang.sh index 974499ba1..60a775536 100755 --- a/builder-base/scripts/check_upstream_golang.sh +++ b/builder-base/scripts/check_upstream_golang.sh @@ -60,7 +60,7 @@ ACTIVE_VERSIONS=$(curl https://go.dev/dl/?mode=json | jq -r '.[].version' | sed for version in ${ACTIVE_VERSIONS}; do # pull golang versions in the versions.yaml MAJORVERSION=$(if [[ $(echo "$version" | awk -F'.' '{print NF}') -ge 3 ]]; then echo ${version%.*}; else echo ${version%-*}; fi) - BUILDER_BASE_GO_VERSION=$(cat "${VERSIONS_YAML}" | grep -E "^GOLANG_VERSION_${MAJORVERSION//./}") || "" + BUILDER_BASE_GO_VERSION=$(cat "${VERSIONS_YAML}" | grep -E "^GOLANG_VERSION_${MAJORVERSION//./}") || echo "" # check builder-base versions for the upstream version of golang # if the version doesn't exist in the builder base update the versions yaml. if [[ -n $BUILDER_BASE_GO_VERSION && ! $BUILDER_BASE_GO_VERSION =~ $version ]]; then diff --git a/eks-distro-base/scripts/check_upstream_golang b/eks-distro-base/scripts/check_upstream_golang index a9782b94d..51d4ae11c 100755 --- a/eks-distro-base/scripts/check_upstream_golang +++ b/eks-distro-base/scripts/check_upstream_golang @@ -41,7 +41,7 @@ ACTIVE_VERSIONS=$(curl https://go.dev/dl/?mode=json | jq -r '.[].version' | sed for version in ${ACTIVE_VERSIONS}; do # pull golang versions in the versions.yaml MAJORVERSION=$(if [[ $(echo "$version" | awk -F'.' '{print NF}') -ge 3 ]]; then echo ${version%.*}; else echo ${version%-*}; fi) - MINIMAL_GO_VERSION=$(cat "${VERSIONS_YAML}" | grep -E "^GOLANG_${MAJORVERSION}_FULL_VERSION") || "" + MINIMAL_GO_VERSION=$(yq 'eval(.golang.versions["GOLANG_1.21_FULL_VERSION"])' "$VERSIONS_YAML" || echo "") # check builder-base versions for the upstream version of golang # if the version doesn't exist in the builder base update the versions yaml. if [[ ! $MINIMAL_GO_VERSION =~ $version ]]; then