diff --git a/automation/check-patch.setup.sh b/automation/check-patch.setup.sh index 2c0d7a3ddb..8a024a4fb7 100755 --- a/automation/check-patch.setup.sh +++ b/automation/check-patch.setup.sh @@ -9,7 +9,10 @@ rm -rf $tmp_dir mkdir -p $tmp_dir if gimme --help > /dev/null 2>&1; then - export GIMME_GO_VERSION=$(grep '^go' go.mod |sed 's/go //') + + go_mod_version=$(grep '^go' go.mod |sed 's/go //') + full_version=$(curl -s https://go.dev/dl/?mode=json |jq -r .[].version |grep "$go_mod_version") + export GIMME_GO_VERSION=$(echo $full_version |sed 's/go//') echo "Installing go $GIMME_GO_VERSION with gimme" eval "$(gimme)" else diff --git a/build/install-go.sh b/build/install-go.sh index 22bb9ab745..78b38b2545 100755 --- a/build/install-go.sh +++ b/build/install-go.sh @@ -3,6 +3,10 @@ version=$1 arch="" os=linux +go_mod_version=$1 + +dnf install -y jq +full_version=$(curl -s https://go.dev/dl/?mode=json |jq -r .[].version |grep "$go_mod_version") case $(uname -m) in x86_64) arch="amd64";; @@ -14,6 +18,6 @@ if [ "$arch" == "" ]; then exit 1 fi -tarball_url="https://go.dev/dl/go${version}.${os}-${arch}.tar.gz" +tarball_url="https://go.dev/dl/${full_version}.${os}-${arch}.tar.gz" curl --retry 10 -L $tarball_url | tar -C /usr/local -zxf - diff --git a/go.mod b/go.mod index 8e8ffcb113..b2607d94ab 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nmstate/kubernetes-nmstate -go 1.22.4 +go 1.22 require ( github.com/evanphx/json-patch v5.6.0+incompatible