Skip to content

Commit

Permalink
Disable internal encryption for non TLS test (#409)
Browse files Browse the repository at this point in the history
* Disable internal-encryption

* Use util function to surely update the config
  • Loading branch information
nak3 authored Aug 7, 2023
1 parent e2f4f57 commit 67ed433
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions openshift/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,22 @@ function install_knative(){

# TODO: Only one cluster enables internal-tls but it should be enabled by default when the feature is stable.
if [[ ${ENABLE_INTERNAL_TLS:-} == "true" ]]; then
oc patch knativeserving knative-serving \
-n "${SERVING_NAMESPACE}" \
--type merge --patch '{"spec": {"config": {"network": {"internal-encryption": "true"}}}}'
oc patch knativeserving knative-serving \
-n "${SERVING_NAMESPACE}" \
--type merge --patch '{"spec": {"config": {"kourier": {"cluster-cert-secret": "server-certs"}}}}'
configure_cm network internal-encryption:true || fail_test
configure_cm kourier cluster-cert-secret:server-certs || fail_test
# Deploy certificates for testing TLS with cluster-local gateway
timeout 600 '[[ $(oc get ns $SERVING_INGRESS_NAMESPACE -oname | wc -l) == 0 ]]' || return 1
yq read --doc 1 ./test/config/tls/cert-secret.yaml | yq write - metadata.namespace ${SERVING_INGRESS_NAMESPACE} | oc apply -f -
echo "Restart activator to mount the certificates"
oc delete pod -n ${SERVING_NAMESPACE} -l app=activator
oc wait --timeout=60s --for=condition=Available deployment -n ${SERVING_NAMESPACE} activator
echo "internal-encryption is enabled"
else
# disable internal-encryption. S-O repo would enable by default.
configure_cm network internal-encryption:false || fail_test
echo "Restart activator to unmount the certificates"
oc delete pod -n ${SERVING_NAMESPACE} -l app=activator
oc wait --timeout=60s --for=condition=Available deployment -n ${SERVING_NAMESPACE} activator
echo "internal-encryption is disabled"
fi

header "Knative Installed successfully"
Expand Down

0 comments on commit 67ed433

Please sign in to comment.