#!/usr/bin/env bash # Copyright 2020 The Knative Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. source $(dirname "$0")/e2e-common.sh function setup_external_domain_tls_env_variables() { # DNS zone for the testing domain. export EXTERNAL_DOMAIN_TLS_TEST_DNS_ZONE="knative-e2e" # Google Cloud project that hosts the DNS server for the testing domain `kn-e2e.dev` export EXTERNAL_DOMAIN_TLS_TEST_CLOUD_DNS_PROJECT="knative-e2e-dns" # The service account credential file used to access the DNS server. export EXTERNAL_DOMAIN_TLS_TEST_CLOUD_DNS_SERVICE_ACCOUNT_KEY_FILE="${GOOGLE_APPLICATION_CREDENTIALS}" export EXTERNAL_DOMAIN_TLS_TEST_DOMAIN_NAME="kn-e2e.dev" export CUSTOM_DOMAIN_SUFFIX="$(($RANDOM % 10000)).${E2E_PROJECT_ID}.${EXTERNAL_DOMAIN_TLS_TEST_DOMAIN_NAME}" export TLS_TEST_NAMESPACE="tls" local INGRESS_NAMESPACE=${GATEWAY_NAMESPACE_OVERRIDE} if [[ -z "${GATEWAY_NAMESPACE_OVERRIDE}" ]]; then INGRESS_NAMESPACE="istio-system" fi local INGRESS_SERVICE=${GATEWAY_OVERRIDE} if [[ -z "${GATEWAY_OVERRIDE}" ]]; then INGRESS_SERVICE="istio-ingressgateway" fi local IP=$(kubectl get svc -n ${INGRESS_NAMESPACE} ${INGRESS_SERVICE} -o jsonpath="{.status.loadBalancer.ingress[0].ip}") export EXTERNAL_DOMAIN_TLS_TEST_INGRESS_IP=${IP} } function setup_custom_domain() { echo ">> Configuring custom domain for External Domain TLS tests: ${CUSTOM_DOMAIN_SUFFIX}" cat <