Skip to content

Commit fa2b05c

Browse files
authored
Merge pull request #2325 from Nordix/fix/toolchain-1.25
Makefile: pin the toolchain to the same version as in go.mod
2 parents bee173a + 8c2c952 commit fa2b05c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ BASE_IMAGE_MINIMAL ?= scratch
1717
# same site url than the "host" it binds to. Thus, all the links will be
1818
# broken if we'd bind to 0.0.0.0
1919
RUBY_IMAGE_VERSION := 3.3
20+
TOOOLCHAIN_MODE ?= $(shell $(GO_CMD) env GOVERSION)+auto
2021
JEKYLL_ENV ?= development
2122
SITE_BUILD_CMD := $(CONTAINER_RUN_CMD) --rm -i -u "`id -u`:`id -g`" \
2223
$(shell [ -t 0 ] && echo '-t') \
@@ -211,9 +212,10 @@ helm-push:
211212
--config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \
212213
artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml
213214

215+
# TODO: Remove TOOOLCHAIN_MODE variable when fixed in upstream Go toolchain. Ref: https://github.com/golang/go/issues/75031
214216
test:
215-
$(GO_CMD) test -covermode=atomic -coverprofile=coverage.out ./cmd/... ./pkg/... ./source/...
216-
cd api/nfd && $(GO_CMD) test -covermode=atomic -coverprofile=coverage.out ./...
217+
GOTOOLCHAIN=${TOOOLCHAIN_MODE} $(GO_CMD) test -covermode=atomic -coverprofile=coverage.out ./cmd/... ./pkg/... ./source/...
218+
cd api/nfd && GOTOOLCHAIN=${TOOOLCHAIN_MODE} $(GO_CMD) test -covermode=atomic -coverprofile=coverage.out ./...
217219

218220
e2e-test:
219221
@if [ -z ${KUBECONFIG} ]; then echo "[ERR] KUBECONFIG missing, must be defined"; exit 1; fi

0 commit comments

Comments
 (0)