Skip to content

Commit 8fed0e9

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 c352f05 commit 8fed0e9

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
@@ -206,6 +206,7 @@ GINKGO ?= $(LOCALBIN)/ginkgo
206206
## Tool Versions
207207
KUSTOMIZE_VERSION ?= v3.8.7
208208
CONTROLLER_TOOLS_VERSION ?= v0.11.1
209+
GOTOOLCHAIN_VERSION ?= go1.21.0
209210

210211
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
211212
.PHONY: kustomize
@@ -346,7 +347,7 @@ golint: get-ci-tools
346347

347348
.PHONY: gowork
348349
gowork: ## Generate go.work file to support our multi module repository
349-
test -f go.work || go work init
350+
test -f go.work || GOTOOLCHAIN=$(GOTOOLCHAIN_VERSION) go work init
350351
go work use .
351352
go work use ./api
352353
go work sync

0 commit comments

Comments
 (0)