From e92f23412f0a44151133262ddaac62fb67b2636f Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Wed, 31 Aug 2022 14:49:02 +0900 Subject: [PATCH] Add a target to enable internal-tls in Makefile (#1224) * Add a target to enable internal-tls in Makefile * Update CI template for internal-tls enabled --- Makefile | 4 ++++ openshift/ci-operator/generate-ci-config.sh | 5 ++++- openshift/ci-operator/update-ci.sh | 5 ++--- openshift/e2e-common.sh | 2 +- openshift/e2e-tests.sh | 2 ++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b21a6222ead6..ea76edd5b956 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,10 @@ test-e2e: ./openshift/e2e-tests.sh .PHONY: test-e2e +test-e2e-tls: + ENABLE_INTERNAL_TLS="true" ./openshift/e2e-tests.sh +.PHONY: test-e2e-tls + test-images: for img in $(TEST_IMAGES); do \ KO_DOCKER_REPO=$(DOCKER_REPO_OVERRIDE) ko resolve --tags=$(TEST_IMAGE_TAG) $(KO_FLAGS) -RBf $$img ; \ diff --git a/openshift/ci-operator/generate-ci-config.sh b/openshift/ci-operator/generate-ci-config.sh index 615a197c5944..cd66386a9c45 100755 --- a/openshift/ci-operator/generate-ci-config.sh +++ b/openshift/ci-operator/generate-ci-config.sh @@ -4,6 +4,7 @@ branch=${1-'knative-v0.6.0'} openshift=${2-'4.3'} promotion_disabled=${3-false} generate_continuous=${4-false} +internal_tls_enabled=${5-false} if [[ "$branch" == "knative-next" ]]; then promotion_name="knative-nightly" @@ -150,7 +151,9 @@ EOF print_single_test "e2e-aws-ocp-${openshift//./}" "make test-e2e" "" "true" "generic-claim" "" - if [[ "$generate_continuous" == true ]]; then + if [[ "$internal_tls_enabled" == true ]]; then + print_single_test "e2e-aws-ocp-${openshift//./}-continuous" "make test-e2e-tls" "" "true" "generic-claim" "${cron}" + elif [[ "$generate_continuous" == true ]]; then print_single_test "e2e-aws-ocp-${openshift//./}-continuous" "make test-e2e" "" "true" "generic-claim" "${cron}" fi diff --git a/openshift/ci-operator/update-ci.sh b/openshift/ci-operator/update-ci.sh index 128b0f50965f..f264ac5f7302 100755 --- a/openshift/ci-operator/update-ci.sh +++ b/openshift/ci-operator/update-ci.sh @@ -39,14 +39,13 @@ CONFIG=$CONFIGDIR/openshift-knative-serving-release-$VERSION PERIODIC_CONFIG=$PERIODIC_CONFIGDIR/openshift-knative-serving-release-$VERSION-periodics.yaml CURDIR=$(dirname $0) -# $1=branch $2=openshift $3=promotion_disabled $4=generate_continuous +# $1=branch $2=openshift $3=promotion_disabled $4=generate_continuous $5=internal_tls_enabled(optional) $CURDIR/generate-ci-config.sh knative-$VERSION 4.6 true false > ${CONFIG}__46.yaml $CURDIR/generate-ci-config.sh knative-$VERSION 4.7 true false > ${CONFIG}__47.yaml $CURDIR/generate-ci-config.sh knative-$VERSION 4.8 true false > ${CONFIG}__48.yaml $CURDIR/generate-ci-config.sh knative-$VERSION 4.9 true false > ${CONFIG}__49.yaml $CURDIR/generate-ci-config.sh knative-$VERSION 4.10 true false > ${CONFIG}__410.yaml -$CURDIR/generate-ci-config.sh knative-$VERSION 4.11 true false > ${CONFIG}__411-tls.yaml -$CURDIR/generate-ci-config.sh knative-$VERSION 4.11 false true > ${CONFIG}__411.yaml +$CURDIR/generate-ci-config.sh knative-$VERSION 4.11 true false true > ${CONFIG}__411-tls.yaml # Append missing lines to the mirror file. if [[ "$VERSION" != "next" ]]; then diff --git a/openshift/e2e-common.sh b/openshift/e2e-common.sh index 28067e85b360..3ad9dd8cea9a 100644 --- a/openshift/e2e-common.sh +++ b/openshift/e2e-common.sh @@ -230,7 +230,7 @@ spec: EOF # TODO: Only one cluster enables internal-tls but it should be enabled by default when the feature is stable. - if [[ ${JOB_NAME} =~ "tls" ]]; then + if [[ ${ENABLE_INTERNAL_TLS} == "true" ]]; then oc patch knativeserving knative-serving \ -n "${SERVING_NAMESPACE}" \ --type merge --patch '{"spec": {"config": {"network": {"internal-encryption": "true"}}}}' diff --git a/openshift/e2e-tests.sh b/openshift/e2e-tests.sh index 1f1d7318829d..4575200c8091 100755 --- a/openshift/e2e-tests.sh +++ b/openshift/e2e-tests.sh @@ -9,6 +9,8 @@ env failed=0 +export ENABLE_INTERNAL_TLS="${ENABLE_INTERNAL_TLS:-false}" + (( !failed )) && install_knative || failed=1 (( !failed )) && prepare_knative_serving_tests_nightly || failed=2 (( !failed )) && run_e2e_tests || failed=3