We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b54c1ba + e681b17 commit dc4d0aeCopy full SHA for dc4d0ae
prow.sh
@@ -564,7 +564,15 @@ go_version_for_kubernetes () (
564
local version="$2"
565
local go_version
566
567
- # 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
568
+ go_version="$( cat "$path/.go-version" )"
569
+ if [ "$go_version" ]; then
570
+ echo "$go_version"
571
+ return
572
+ fi
573
+
574
+ # Fall back to hack/lib/golang.sh parsing.
575
+ # This is necessary in v1.26.0 and older Kubernetes releases that do not have .go-version.
576
# More recent versions might also work, but we don't want to count on that.
577
go_version="$(grep minimum_go_version= "$path/hack/lib/golang.sh" | sed -e 's/.*=go//')"
578
if ! [ "$go_version" ]; then
0 commit comments