Skip to content

Commit 6f7b8da

Browse files
committed
set GOTOOLCHAIN min version when init go.work
When the golang version does not match the version used inside the build container, dowloading the modules can fail with: ~~~ go: go.work requires go >= 1.21.13 (running go 1.21.11; GOTOOLCHAIN=local) ~~~ This PR makes set the GOTOOLCHAIN to set 1.21.0 as the min required version and sets it in go.work file. Signed-off-by: Martin Schuppert <[email protected]>
1 parent b932803 commit 6f7b8da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ GINKGO ?= $(LOCALBIN)/ginkgo
199199
## Tool Versions
200200
KUSTOMIZE_VERSION ?= v3.8.7
201201
CONTROLLER_TOOLS_VERSION ?= v0.11.1
202+
GOTOOLCHAIN_VERSION ?= go1.21.0
202203

203204
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
204205
.PHONY: kustomize
@@ -334,7 +335,7 @@ golint: get-ci-tools
334335

335336
.PHONY: gowork
336337
gowork: ## Generate go.work file to support our multi module repository
337-
test -f go.work || go work init
338+
test -f go.work || GOTOOLCHAIN=$(GOTOOLCHAIN_VERSION) go work init
338339
go work use .
339340
go work use ./api
340341

0 commit comments

Comments
 (0)