Skip to content

Commit

Permalink
Stop assuming that !Gloo=Istio and that mesh is Istio only. (#5782)
Browse files Browse the repository at this point in the history
  • Loading branch information
JRBANCEL authored and knative-prow-robot committed Oct 29, 2019
1 parent 4325ba5 commit 356bb51
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
33 changes: 16 additions & 17 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ E2E_CLUSTER_MACHINE=${E2E_CLUSTER_MACHINE:-n1-standard-8}
# This script provides helper methods to perform cluster actions.
source $(dirname $0)/../vendor/knative.dev/test-infra/scripts/e2e-tests.sh

# Default Istio configuration to install: 1.2-latest, no mesh, cert manager 0.6.1.
ISTIO_VERSION="1.2-latest"
ISTIO_MESH=0
CERT_MANAGER_VERSION="0.9.1"
ISTIO_VERSION=""
GLOO_VERSION=""

# Current YAMLs used to install Knative Serving.
INSTALL_RELEASE_YAML=""
Expand Down Expand Up @@ -60,11 +59,11 @@ function parse_flags() {
return 2
;;
--mesh)
readonly ISTIO_MESH=1
readonly MESH=1
return 1
;;
--no-mesh)
readonly ISTIO_MESH=0
readonly MESH=0
return 1
;;
--install-monitoring)
Expand Down Expand Up @@ -99,8 +98,8 @@ function parse_flags() {
function build_knative_from_source() {
local YAML_LIST="$(mktemp)"

# set ko flags to omit istio resources from generated YAMLs
if [[ -n "${GLOO_VERSION}" ]]; then
# Set ko flags to omit istio resources from generated YAMLs
if [[ -z "${ISTIO_VERSION}" ]]; then
KO_FLAGS="${KO_FLAGS} --selector=networking.knative.dev/ingress-provider!=istio"
fi

Expand Down Expand Up @@ -138,7 +137,7 @@ function install_knative_serving() {
function install_istio() {
local istio_base="./third_party/istio-${ISTIO_VERSION}"
INSTALL_ISTIO_CRD_YAML="${istio_base}/istio-crds.yaml"
(( ISTIO_MESH )) && INSTALL_ISTIO_YAML="${istio_base}/istio.yaml" || INSTALL_ISTIO_YAML="${istio_base}/istio-lean.yaml"
(( MESH )) && INSTALL_ISTIO_YAML="${istio_base}/istio.yaml" || INSTALL_ISTIO_YAML="${istio_base}/istio-lean.yaml"

echo "Istio CRD YAML: ${INSTALL_ISTIO_CRD_YAML}"
echo "Istio YAML: ${INSTALL_ISTIO_YAML}"
Expand Down Expand Up @@ -194,11 +193,10 @@ function install_knative_serving_standard() {
echo "Cert Manager YAML: ${INSTALL_CERT_MANAGER_YAML}"
echo "Knative YAML: ${INSTALL_RELEASE_YAML}"

if [[ -z "${GLOO_VERSION}" ]]; then
# install istio as the default knative ingress
if [[ -n "${ISTIO_VERSION}" ]]; then
install_istio
else
# install gloo if $GLOO_VERSION is provided
fi
if [[ -n "${GLOO_VERSION}" ]]; then
install_gloo
fi

Expand Down Expand Up @@ -240,7 +238,7 @@ EOF
kubectl -n knative-serving patch hpa activator --patch '{"spec":{"minReplicas":2}}' || return 1

# post-install steps for istio
if [[ -z "${GLOO_VERSION}" ]]; then
if [[ -n "${ISTIO_VERSION}" ]]; then
# Due to the lack of Status in Istio, we have to ignore failures in initial requests.
#
# However, since network configurations may reach different ingress pods at slightly
Expand Down Expand Up @@ -331,7 +329,7 @@ function test_setup() {

echo ">> Creating test resources (test/config/)"
ko apply ${KO_FLAGS} -f test/config/ || return 1
if (( ISTIO_MESH )); then
if (( MESH )); then
if [[ ${ISTIO_VERSION} =~ 1.3.* ]]; then
# TODO: Enable mTLS with Istio 1.3 once https://github.com/knative/serving/issues/5725 is identified.
continue
Expand All @@ -341,10 +339,11 @@ function test_setup() {
fi
${REPO_ROOT_DIR}/test/upload-test-images.sh || return 1
wait_until_pods_running knative-serving || return 1
if [[ -z "${GLOO_VERSION}" ]]; then
if [[ -n "${ISTIO_VERSION}" ]]; then
wait_until_pods_running istio-system || return 1
wait_until_service_has_external_ip istio-system istio-ingressgateway
else
fi
if [[ -n "${GLOO_VERSION}" ]]; then
# we must set these override values to allow the test spoofing client to work with Gloo
# see https://github.com/knative/pkg/blob/release-0.7/test/ingress/ingress.go#L37
export GATEWAY_OVERRIDE=knative-external-proxy
Expand All @@ -361,7 +360,7 @@ function test_setup() {
function test_teardown() {
echo ">> Removing test resources (test/config/)"
ko delete --ignore-not-found=true --now -f test/config/
(( ISTIO_MESH )) && ko delete --ignore-not-found=true --now -f test/config/mtls/
(( MESH )) && ko delete --ignore-not-found=true --now -f test/config/mtls/
echo ">> Ensuring test namespaces are clean"
kubectl delete all --all --ignore-not-found --now --timeout 60s -n serving-tests
kubectl delete --ignore-not-found --now --timeout 60s namespace serving-tests
Expand Down
5 changes: 2 additions & 3 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ failed=0

# Run tests serially in the mesh scenario
parallelism=""
(( ISTIO_MESH )) && parallelism="-parallel 1"
(( MESH )) && parallelism="-parallel 1"

# Run conformance and e2e tests.
go_test_e2e -timeout=30m \
Expand All @@ -60,8 +60,7 @@ go_test_e2e -timeout=10m \
./test/scale || failed=1

# Istio E2E tests mutate the cluster and must be ran separately
# TODO(https://github.com/knative/test-infra/issues/1398): use proper flags instead of binary GLOO/no GLOO
if [[ -z "${GLOO_VERSION}" ]]; then
if [[ -n "${ISTIO_VERSION}" ]]; then
go_test_e2e -timeout=10m \
./test/e2e/istio \
"--resolvabledomain=$(use_resolvable_domain)" || failed=1
Expand Down

0 comments on commit 356bb51

Please sign in to comment.