Skip to content

Commit 9cfc05f

Browse files
authored
build: Use go 1.22.5 toolchain to fix CVE (#780)
This was highlighted by failing govulncheck builds in other PRs. Fixes https://pkg.go.dev/vuln/GO-2024-2963.
1 parent a2bd68f commit 9cfc05f

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

api/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/ap
55

66
go 1.21
77

8-
toolchain go1.22.4
8+
toolchain go1.22.5
99

1010
replace github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common => ../common
1111

common/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/co
55

66
go 1.21
77

8-
toolchain go1.22.4
8+
toolchain go1.22.5
99

1010
replace github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api => ../api
1111

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix
55

66
go 1.21
77

8-
toolchain go1.22.4
8+
toolchain go1.22.5
99

1010
replace (
1111
github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api => ./api

make/go.mk

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,24 @@ ifneq ($(words $(GO_SUBMODULES_NO_DOCS)),0)
217217
govulncheck: $(addprefix govulncheck.,$(GO_SUBMODULES_NO_DOCS:/go.mod=))
218218
endif
219219

220-
.PHONY: ggovulncheck.%
220+
.PHONY: govulncheck.%
221221
govulncheck.%: ## Runs golangci-lint for a specific module
222222
govulncheck.%: ; $(info $(M) running govulncheck on $* module)
223223
$(if $(filter-out root .,$*),cd $* && )govulncheck ./...
224+
225+
.PHONY: go-mod-edit-toolchain
226+
go-mod-edit-toolchain: ## Edits the go.mod file of all modules in repository to use the toolchain version
227+
ifneq ($(wildcard $(REPO_ROOT)/go.mod),)
228+
go-mod-edit-toolchain: go-mod-edit-toolchain.root
229+
endif
230+
ifneq ($(words $(GO_SUBMODULES_NO_DOCS)),0)
231+
go-mod-edit-toolchain: $(addprefix go-mod-edit-toolchain.,$(GO_SUBMODULES_NO_DOCS:/go.mod=))
232+
endif
233+
234+
.PHONY: go-mod-edit-toolchain.%
235+
go-mod-edit-toolchain.%: ## Edits the go.mod file of a specifc module in repository to use the toolchain version
236+
go-mod-edit-toolchain.%: ; $(info $(M) setting go toolchain for $* module)
237+
ifndef GO_TOOLCHAIN_VERSION
238+
$(error GO_TOOLCHAIN_VERSION is not set: please set GO_TOOLCHAIN_VERSION to the desired version, e.g. go1.22.5)
239+
endif
240+
$(if $(filter-out root .,$*),cd $* && )go mod edit -toolchain=$(GO_TOOLCHAIN_VERSION)

0 commit comments

Comments
 (0)