Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,12 @@ vet: check-go ## Run go vet against code.
go vet -mod=mod ./...

ENVTEST := $(shell pwd)/bin/setup-envtest
ENVTESTPATH = $(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)
ifeq ($(shell $(ENVTEST) list | grep $(ENVTEST_K8S_VERSION)),)
ENVTESTPATH = $(shell $(ENVTEST) --arch=amd64 use $(ENVTEST_K8S_VERSION) -p path)
endif
# Native-arch resolution first, falling back to amd64 only if that fails (e.g. no
# native-arch envtest assets published for this k8s version). Done as a single shell
# expression (not a make ifeq) so it's decided when ENVTESTPATH is actually referenced
# in a recipe, after $(ENVTEST) is guaranteed installed for the host's real arch --
# not at Makefile-parse time against a possibly-cold bin/ (see issue #2377).
ENVTESTPATH = $(shell out=$$($(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path 2>/dev/null); if [ -z "$$out" ]; then out=$$($(ENVTEST) --arch=amd64 use $(ENVTEST_K8S_VERSION) -p path 2>/dev/null); fi; echo "$$out")
.PHONY: check-envtest-arch
check-envtest-arch:
@if [ -f $(ENVTEST) ] && ! $(ENVTEST) --help >/dev/null 2>&1; then \
Expand Down
Loading