From e5d80dbe6b2ef757a1ef25fe435666133c1253ac Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Wed, 18 Sep 2024 10:34:36 +0200 Subject: [PATCH] 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 --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d74095b0..cc8ebe14 100644 --- a/Makefile +++ b/Makefile @@ -153,7 +153,7 @@ test: manifests generate fmt vet envtest ginkgo ## Run tests. .PHONY: gowork gowork: export GOWORK= gowork: ## Generate go.work file to support our multi module repository - test -f go.work || go work init + test -f go.work || GOTOOLCHAIN=$(GOTOOLCHAIN_VERSION) go work init go work use . go work use ./api go work sync @@ -242,6 +242,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions KUSTOMIZE_VERSION ?= v3.8.7 CONTROLLER_TOOLS_VERSION ?= v0.11.1 +GOTOOLCHAIN_VERSION ?= go1.21.0 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" .PHONY: kustomize