From 2f082ab0466589a0e5b40fa2c36567aeb3878c94 Mon Sep 17 00:00:00 2001 From: xing-yang Date: Thu, 22 Feb 2024 11:02:57 -0500 Subject: [PATCH] WIP: Test go version --- release-tools/prow.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/release-tools/prow.sh b/release-tools/prow.sh index a27c71f3d..0af3fdcd8 100755 --- a/release-tools/prow.sh +++ b/release-tools/prow.sh @@ -564,7 +564,15 @@ go_version_for_kubernetes () ( local version="$2" local go_version - # We use the minimal Go version specified for each K8S release (= minimum_go_version in hack/lib/golang.sh). + # Try to get the version for .go-version + go_version="$( cat "$path/.go-version" )" + if [ "$go_version" ]; then + echo "$go_version" + return + fi + + # Fall back to hack/lib/golang.sh parsing. + # This is necessary in v1.26.0 and older Kubernetes releases that do not have .go-version. # More recent versions might also work, but we don't want to count on that. go_version="$(grep minimum_go_version= "$path/hack/lib/golang.sh" | sed -e 's/.*=go//')" if ! [ "$go_version" ]; then