Add Makefile for local testing (#327)

This commit is contained in:
Marco Franssen
2023-05-30 16:19:23 -07:00
committed by GitHub
parent 9fa1ec28a7
commit d333154369
4 changed files with 43 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
.PHONY: help
help: ## Display this help.
@$(MAKE) help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Testing:
.PHONY: clean-lingering-resources
clean-lingering-resources:
@echo Cleanup potential leftovers…
@-kubectl delete csidrivers.storage.k8s.io csi.spiffe.io \
&>/dev/null || true
@-kubectl delete ns \
$$(kubectl get ns -o json | jq -r '.items[] | .metadata.name' | grep spire) \
&>/dev/null || true
@-kubectl delete validatingwebhookconfigurations.admissionregistration.k8s.io \
$$(kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io -o json | jq -r '.items[] | .metadata.name' | grep spire) \
&>/dev/null || true
.PHONY: test
test: ## Run tests using Helm chart-testing (ensure to run on dedicated test cluster)
@echo Running tests…
@ct install --debug \
--charts charts/spire