Skip to content

Commit

Permalink
remove stableMM from goVersions return
Browse files Browse the repository at this point in the history
  • Loading branch information
spowelljr authored and medyagh committed May 7, 2024
1 parent 904d97f commit c1b68a9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions hack/update/golang_version/update_golang_version.go
Expand Up @@ -82,7 +82,7 @@ func main() {
addGitHubWorkflowFiles()

// get Golang stable version
stable, _, k8sVersion, err := goVersions()
stable, k8sVersion, err := goVersions()
if err != nil || stable == "" {
klog.Fatalf("Unable to get Golang stable version: %v", err)
}
Expand All @@ -102,24 +102,22 @@ func main() {
}

// goVersions returns Golang stable version.
func goVersions() (stable, stableMM, k8sVersion string, err error) {
func goVersions() (stable, k8sVersion string, err error) {
// will update to the same image that kubernetes project uses
resp, err := http.Get("https://raw.githubusercontent.com/kubernetes/kubernetes/master/build/build-image/cross/VERSION")
if err != nil {
return "", "", "", err
return "", "", err
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return "", "", "", err
return "", "", err
}
// example response: v1.23.0-go1.17-buster.0
stable = string(body)
k8sVersion = strings.Split(stable, "-")[0]
stable = strings.Split(stable, "-")[1]
stable = strings.Replace(stable, "go", "", 1)
mmp := strings.SplitN(stable, ".", 3)
stableMM = strings.Join(mmp[0:2], ".") // <major>.<minor> version
return stable, stableMM, k8sVersion, nil
return stable, k8sVersion, nil
}

func updateGoHashFile(version string) error {
Expand Down

0 comments on commit c1b68a9

Please sign in to comment.