Skip to content

Commit

Permalink
Prevent e2e-tests from running on non-local clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Kursell committed Feb 28, 2019
1 parent be1329b commit 047aeb5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ PKG = k8s.io/ingress-nginx
ARCH ?= $(shell go env GOARCH)
GOARCH = ${ARCH}
DUMB_ARCH = ${ARCH}
KUBECTL_CONTEXT = $(shell kubectl config current-context)

GOBUILD_FLAGS :=

Expand Down Expand Up @@ -182,6 +183,14 @@ lua-test:

.PHONY: e2e-test
e2e-test:
if [ "$(KUBECTL_CONTEXT)" != "minikube" ] && \
[ "$(KUBECTL_CONTEXT)" != "kind" ] && \
[ "$(KUBECTL_CONTEXT)" != "dind" ] && \
[ "$(KUBECTL_CONTEXT)" != "docker-for-desktop" ]; then \
echo "kubectl context is "$(KUBECTL_CONTEXT)", but must be one of [minikube, kind, dind, docker-for-deskop]"; \
exit 1; \
fi

echo "Granting permissions to ingress-nginx e2e service account..."
kubectl create serviceaccount ingress-nginx-e2e || true
kubectl create clusterrolebinding permissive-binding \
Expand Down

0 comments on commit 047aeb5

Please sign in to comment.