Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable to e2e-test with contour and kourier #1337

Closed
BbolroC opened this issue Jun 3, 2021 · 0 comments · Fixed by #1339
Closed

Enable to e2e-test with contour and kourier #1337

BbolroC opened this issue Jun 3, 2021 · 0 comments · Fixed by #1339

Comments

@BbolroC
Copy link
Contributor

BbolroC commented Jun 3, 2021

The current e2e test only runs over the network istio. It would be good to run the test over other network layers (e.g. contour and kourier) if the network is pre-installed and the environment variable $INGRESS_CLASS is set as follows:

diff --git a/test/common.sh b/test/common.sh
index 4d706168..e54a52ac 100755
--- a/test/common.sh
+++ b/test/common.sh
@@ -16,6 +16,12 @@
 
 source $(dirname $0)/../vendor/knative.dev/hack/e2e-tests.sh
 
+export INGRESS_CLASS=${INGRESS_CLASS:-istio.ingress.networking.knative.dev}
+
+function is_ingress_class() {
+  [[ "${INGRESS_CLASS}" == *"${1}"* ]]
+}
+
 function cluster_setup() {
   header "Building client"
   ${REPO_ROOT_DIR}/hack/build.sh -f || return 1
@@ -59,7 +65,9 @@ function install_istio() {
 }
 
 function knative_setup() {
-  install_istio
+  if is_ingress_class istio; then
+    install_istio
+  fi
 
   local serving_version=${KNATIVE_SERVING_VERSION:-latest}
   header "Installing Knative Serving (${serving_version})"
@@ -88,6 +88,11 @@ function knative_setup() {
     wait_until_pods_running knative-serving || return 1
   fi
 
+  if ! is_ingress_class istio; then
+    kubectl patch configmap/config-network -n knative-serving \
+      --type merge -p '{"data": {"ingress.class":"'${INGRESS_CLASS}'"}}'
+  fi
+
   local eventing_version=${KNATIVE_EVENTING_VERSION:-latest}
   header "Installing Knative Eventing (${eventing_version})"

I would like to get some feedback on this. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant