Skip to content

Commit 4d3b73d

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 e7f05cf commit 4d3b73d

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
@@ -269,6 +269,7 @@ KUSTOMIZE_VERSION ?= v3.8.7
269269
CONTROLLER_TOOLS_VERSION ?= v0.11.1
270270
CRD_MARKDOWN_VERSION ?= v0.0.3
271271
KUTTL_VERSION ?= 0.17.0
272+
GOTOOLCHAIN_VERSION ?= go1.21.0
272273

273274
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
274275
.PHONY: kustomize
@@ -437,7 +438,7 @@ golint: get-ci-tools
437438

438439
.PHONY: gowork
439440
gowork: ## Generate go.work file to support our multi module repository
440-
test -f go.work || go work init
441+
test -f go.work || GOTOOLCHAIN=$(GOTOOLCHAIN_VERSION) go work init
441442
go work use .
442443
go work use ./apis
443444
go work sync

0 commit comments

Comments
 (0)