Skip to content

Commit

Permalink
updated check_upstream_golang.sh to properly set empty variables
Browse files Browse the repository at this point in the history
  • Loading branch information
vineeth-bandi committed Jul 17, 2024
1 parent 90ef947 commit abac9c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builder-base/scripts/check_upstream_golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eks-distro-base/scripts/check_upstream_golang
Original file line number Diff line number Diff line change
Expand Up @@ -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 ".golang.versions[\"GOLANG_${MAJORVERSION}_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
Expand Down

0 comments on commit abac9c4

Please sign in to comment.