Skip to content

Commit

Permalink
refactor toggle_feature
Browse files Browse the repository at this point in the history
* was having some bash issues with properly interpretting the patch
  • Loading branch information
KauzClay committed Oct 5, 2023
1 parent 192a578 commit 58256a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ function toggle_feature() {
local STATE="$2"
local CONFIG="${3:-config-features}"
echo -n "Setting feature ${FEATURE} to ${STATE}"
kubectl patch cm "${CONFIG}" -n "${SYSTEM_NAMESPACE}" -p '{"data":{"'${FEATURE}'":"'${STATE}'"}}'
local PATCH="{\"data\":{\"${FEATURE}\":\"${STATE}\"}}"
kubectl patch cm "${CONFIG}" -n "${SYSTEM_NAMESPACE}" -p "${PATCH}"
# We don't have a good mechanism for positive handoff so sleep :(
echo "Waiting 30s for change to get picked up."
sleep 30
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ go_test_e2e -timeout=2m ./test/e2e/domainmapping ${E2E_TEST_FLAGS} || failed=1

toggle_feature dataplane-trust enabled config-network || fail_test
toggle_feature "logging.enable-request-log" true config-observability || fail_test
toggle_feature "logging.request-log-template" 'TLS: {{.Request.TLS}}' config-observability || fail_test
toggle_feature "logging.request-log-template" "TLS: {{.Request.TLS}}" config-observability || fail_test
# with current implementation, Activator must be restarted when configuring system-internal-tls. See https://github.com/knative/serving/issues/13754
restart_pod ${SYSTEM_NAMESPACE} "app=activator"
go_test_e2e -timeout=2m ./test/e2e/internalencryption ${E2E_TEST_FLAGS} || failed=1
Expand Down

0 comments on commit 58256a7

Please sign in to comment.