Skip to content

Commit

Permalink
Tidy up makefile rules for KUBEBUILDER_ASSETS
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbooth committed Apr 4, 2024
1 parent 78f7b3f commit 55918b1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,15 @@ ifdef KUBEBUILDER_ASSETS_DIR
setup_envtest_extra_args += --bin-dir $(KUBEBUILDER_ASSETS_DIR)
endif

.PHONY: kubebuilder_assets
kubebuilder_assets: $(SETUP_ENVTEST)
@echo Fetching assets for $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION)
$(eval KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env -p path $(setup_envtest_extra_args) $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION)))

.PHONY: test
TEST_PATHS ?= ./...
test: $(SETUP_ENVTEST) ## Run tests
set -xeuf -o pipefail; \
if [ -z "$(KUBEBUILDER_ASSETS)" ]; then \
KUBEBUILDER_ASSETS=`$(SETUP_ENVTEST) use --use-env -p path $(setup_envtest_extra_args) $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION)`; \
fi; \
KUBEBUILDER_ASSETS="$$KUBEBUILDER_ASSETS" go test -v $(TEST_PATHS) $(TEST_ARGS)
test: kubebuilder_assets
KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test -v $(TEST_PATHS) $(TEST_ARGS)

E2E_TEMPLATES_DIR=test/e2e/data/infrastructure-openstack
E2E_KUSTOMIZE_DIR=test/e2e/data/kustomize
Expand Down

0 comments on commit 55918b1

Please sign in to comment.