Skip to content

Commit

Permalink
Merge pull request #3829 from Shopify/protect-e2e-test
Browse files Browse the repository at this point in the history
Prevent e2e-tests from running on non-local clusters
  • Loading branch information
k8s-ci-robot authored Mar 2, 2019
2 parents 706b62a + 047aeb5 commit 79c52cf
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 79c52cf

Please sign in to comment.