Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Go auto update improvements #18720

Merged
merged 4 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/update-golang-version.yml
Expand Up @@ -55,5 +55,5 @@ jobs:
issue_number: ${{ steps.createPR.outputs.pull-request-number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: 'ok-to-build-iso'
body: 'ok-to-build-image'
})
14 changes: 4 additions & 10 deletions hack/update/golang_version/update_golang_version.go
Expand Up @@ -36,11 +36,6 @@
}

schema = map[string]update.Item{
"go.mod": {
spowelljr marked this conversation as resolved.
Show resolved Hide resolved
Replace: map[string]string{
`(?m)^go .*`: `go {{.StableVersionMM}}`,
},
},
"Makefile": {
Replace: map[string]string{
// searching for 1.* so it does NOT match "KVM_GO_VERSION ?= $(GO_VERSION:.0=)" in the Makefile
Expand Down Expand Up @@ -78,18 +73,17 @@

// Data holds stable Golang version - in full and in <major>.<minor> format
type Data struct {
StableVersion string
StableVersionMM string // go.mod wants go version in <major>.<minor> format
K8SVersion string // as of v1.23.0 Kubernetes uses k8s version in golang image name because: https://github.com/kubernetes/kubernetes/pull/103692#issuecomment-908659826
StableVersion string
K8SVersion string // as of v1.23.0 Kubernetes uses k8s version in golang image name because: https://github.com/kubernetes/kubernetes/pull/103692#issuecomment-908659826

}

func main() {
addGitHubWorkflowFiles()

// get Golang stable version
stable, stableMM, k8sVersion, err := goVersions()
stable, _, k8sVersion, err := goVersions()
if err != nil || stable == "" || stableMM == "" {

Check failure on line 86 in hack/update/golang_version/update_golang_version.go

View workflow job for this annotation

GitHub Actions / lint

undefined: stableMM (typecheck)
klog.Fatalf("Unable to get Golang stable version: %v", err)
}
// skip rc versions
Expand All @@ -97,7 +91,7 @@
klog.Warningf("Golang stable version is a release candidate, skipping: %s", stable)
return
}
data := Data{StableVersion: stable, StableVersionMM: stableMM, K8SVersion: k8sVersion}
data := Data{StableVersion: stable, K8SVersion: k8sVersion}
klog.Infof("Golang stable version: %s", data.StableVersion)

update.Apply(schema, data)
Expand Down