Skip to content

Commit

Permalink
set GOTOOLCHAIN min version when init go.work
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mrkisaolamb authored and openshift-merge-bot[bot] committed Sep 25, 2024
1 parent 1776a61 commit 1247611
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ endif
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

GOTOOLCHAIN_VERSION ?= go1.21.0

.PHONY: all
all: build

Expand Down Expand Up @@ -334,7 +336,7 @@ golint: get-ci-tools

.PHONY: 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
Expand Down

0 comments on commit 1247611

Please sign in to comment.