File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,14 @@ VERSION ?= $(shell git describe --tags --always --dirty)
55
66KUBERNETES_VERSION = 1.27
77ENVTEST_BIN_ROOT = /tmp/testbin
8- KUBEBUILDER_ASSETS_PATH = $(shell setup-envtest use $(KUBERNETES_VERSION ) --bin-dir=$(ENVTEST_BIN_ROOT ) | grep 'Path:' | awk '{print $$2}')
8+
9+ GOBIN ?= $(shell go env GOBIN)
10+ ifeq ($(GOBIN ) ,)
11+ GOBIN := $(shell go env GOPATH) /bin
12+ endif
13+ SETUP_ENVTEST := $(GOBIN ) /setup-envtest
14+
15+ KUBEBUILDER_ASSETS_PATH = $(shell $(SETUP_ENVTEST ) use $(KUBERNETES_VERSION ) --bin-dir=$(ENVTEST_BIN_ROOT ) | grep 'Path:' | awk '{print $$2}')
916
1017.PHONY : all build clean test setup-envtest fetch-envtest-binaries
1118
@@ -27,7 +34,7 @@ setup-envtest:
2734fetch-envtest-binaries :
2835 @echo " 🌐 Downloading Kubernetes binaries for envtest..."
2936 mkdir -p $(ENVTEST_BIN_ROOT )
30- @setup-envtest use $(KUBERNETES_VERSION ) --bin-dir=$(ENVTEST_BIN_ROOT )
37+ @$( SETUP_ENVTEST ) use $(KUBERNETES_VERSION ) --bin-dir=$(ENVTEST_BIN_ROOT )
3138 @echo " ✅ Binaries fetched into $( KUBEBUILDER_ASSETS_PATH) "
3239
3340test : fetch-envtest-binaries
You can’t perform that action at this time.
0 commit comments