Skip to content

Commit 01d4993

Browse files
committed
set GOTOOLCHAIN min version when init go.work
In the service operators, 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 <mschuppert@redhat.com>
1 parent 5745a15 commit 01d4993

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ GINKGO ?= $(LOCALBIN)/ginkgo
1919

2020
## Tool Versions
2121
CONTROLLER_TOOLS_VERSION ?= v0.11.1
22+
GOTOOLCHAIN_VERSION ?= go1.21.0
2223

2324
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
2425
ENVTEST_K8S_VERSION = 1.29
@@ -133,7 +134,7 @@ golint: get-ci-tools ## Run go lint via ci-tools script against code
133134

134135
.PHONY: gowork
135136
gowork: ## Initiate go work
136-
test -f go.work || go work init
137+
test -f go.work || GOTOOLCHAIN=$(GOTOOLCHAIN_VERSION) go work init
137138
go work use -r modules
138139
go work sync
139140

0 commit comments

Comments
 (0)