From defbe8e105d24e38221ff65fa44f9e0f078b0a2c Mon Sep 17 00:00:00 2001
From: Adriano Cunha <35786489+adrcunha@users.noreply.github.com>
Date: Thu, 22 Nov 2018 10:11:21 -0800
Subject: [PATCH] Don't run E2E tests if DOCKER_REPO_OVERRIDE is the release
 GCR (#274)

---
 scripts/e2e-tests.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/e2e-tests.sh b/scripts/e2e-tests.sh
index 1833d18187..9a84925bb9 100755
--- a/scripts/e2e-tests.sh
+++ b/scripts/e2e-tests.sh
@@ -363,6 +363,12 @@ function initialize() {
 
   (( IS_PROW )) && [[ -z "${GCP_PROJECT}" ]] && IS_BOSKOS=1
 
+  # Safety checks
+
+  if [[ "${DOCKER_REPO_OVERRIDE}" =~ ^gcr.io/knative-releases/?$ ]]; then
+    abort "\$DOCKER_REPO_OVERRIDE is set to ${DOCKER_REPO_OVERRIDE}, which is forbidden"
+  fi
+
   readonly RUN_TESTS
   readonly EMIT_METRICS
   readonly E2E_CLUSTER_VERSION