Skip to content

Commit

Permalink
Add a target to enable internal-tls in Makefile (knative#1224)
Browse files Browse the repository at this point in the history
* Add a target to enable internal-tls in Makefile

* Update CI template for internal-tls enabled
  • Loading branch information
nak3 authored Aug 31, 2022
1 parent 6d0b6c8 commit e92f234
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ; \
Expand Down
5 changes: 4 additions & 1 deletion openshift/ci-operator/generate-ci-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions openshift/ci-operator/update-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openshift/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}}}'
Expand Down
2 changes: 2 additions & 0 deletions openshift/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e92f234

Please sign in to comment.