Skip to content

Commit

Permalink
set GOTOOLCHAIN min version when init go.work
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
stuggi committed Sep 18, 2024
1 parent 5745a15 commit 01d4993
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ GINKGO ?= $(LOCALBIN)/ginkgo

## Tool Versions
CONTROLLER_TOOLS_VERSION ?= v0.11.1
GOTOOLCHAIN_VERSION ?= go1.21.0

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

.PHONY: gowork
gowork: ## Initiate go work
test -f go.work || go work init
test -f go.work || GOTOOLCHAIN=$(GOTOOLCHAIN_VERSION) go work init
go work use -r modules
go work sync

Expand Down

0 comments on commit 01d4993

Please sign in to comment.