Skip to content

Commit 6135cc5

Browse files
committed
Replace usage of setup-envtest.sh with setup-envtest binary.
Upstream has replaced the shell script with a single binary. See kubernetes-sigs/controller-runtime#1488 for more information.
1 parent f02830f commit 6135cc5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ vet: ## Run go vet against code.
8585
go vet ./...
8686

8787
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
88+
SETUP_ENVTEST = $(shell pwd)/bin/setup-envtest
8889
test: manifests generate fmt vet ## Run tests.
8990
mkdir -p ${ENVTEST_ASSETS_DIR}
90-
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.11.1/hack/setup-envtest.sh
91-
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out
91+
$(call go-get-tool,$(SETUP_ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)
92+
source <($(SETUP_ENVTEST) use --bin-dir $(ENVTEST_ASSETS_DIR) -p env); go test ./... -coverprofile cover.out
9293

9394
##@ Build
9495

0 commit comments

Comments
 (0)