File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -564,7 +564,15 @@ go_version_for_kubernetes () (
564564 local version=" $2 "
565565 local go_version
566566
567- # We use the minimal Go version specified for each K8S release (= minimum_go_version in hack/lib/golang.sh).
567+ # 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.
568576 # More recent versions might also work, but we don't want to count on that.
569577 go_version=" $( grep minimum_go_version= " $path /hack/lib/golang.sh" | sed -e ' s/.*=go//' ) "
570578 if ! [ " $go_version " ]; then
You can’t perform that action at this time.
0 commit comments