diff --git a/go.mod b/go.mod index bb9abb1884..22a00dd238 100644 --- a/go.mod +++ b/go.mod @@ -21,11 +21,11 @@ require ( k8s.io/client-go v0.26.5 k8s.io/code-generator v0.26.5 k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 - knative.dev/caching v0.0.0-20230803123121-79fe54161d98 - knative.dev/eventing v0.38.1-0.20230803151922-0fd9aa16ec1e - knative.dev/hack v0.0.0-20230803220206-d7fde305c59f - knative.dev/pkg v0.0.0-20230802191948-8d3f95106327 - knative.dev/serving v0.38.1-0.20230803165821-8ea1cb621ae9 + knative.dev/caching v0.0.0-20230807013813-53d98a451ff9 + knative.dev/eventing v0.38.1-0.20230807061610-f614df300c6a + knative.dev/hack v0.0.0-20230807013713-a75befb4fd4b + knative.dev/pkg v0.0.0-20230807013311-7333c861d13b + knative.dev/serving v0.38.1-0.20230807130311-0f27ffcb3cde sigs.k8s.io/yaml v1.3.0 ) @@ -139,7 +139,7 @@ require ( k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 // indirect k8s.io/klog/v2 v2.80.2-0.20221028030830-9ae4992afb54 // indirect k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect - knative.dev/networking v0.0.0-20230802091048-29da3ac7ef4d // indirect + knative.dev/networking v0.0.0-20230803123221-e8f756206c6a // indirect sigs.k8s.io/controller-runtime v0.7.2 // indirect sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect diff --git a/go.sum b/go.sum index c89fffe18e..5488084f02 100644 --- a/go.sum +++ b/go.sum @@ -1410,18 +1410,18 @@ k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8= k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/caching v0.0.0-20230803123121-79fe54161d98 h1:Hr1b6uaZqEJWwJq0P1cVXPanuPKgYyc8CLfWdvh5gn0= -knative.dev/caching v0.0.0-20230803123121-79fe54161d98/go.mod h1:Nr05cynfqa26ufhpJ6Az+/wXetGjcD132SCqtCDHavU= -knative.dev/eventing v0.38.1-0.20230803151922-0fd9aa16ec1e h1:J5GLNWOfAYGEHfdw1rWjXE+fIE68vy3NBreOMFwNAPU= -knative.dev/eventing v0.38.1-0.20230803151922-0fd9aa16ec1e/go.mod h1:ct8t+v6nmp1kFCy6ngkDWIEvnjJDNDoKptrfnQVh+z8= -knative.dev/hack v0.0.0-20230803220206-d7fde305c59f h1:lV2VDTQhM6UNEQzWChSjCULG6m7JsvICx6ckQxzg60U= -knative.dev/hack v0.0.0-20230803220206-d7fde305c59f/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= -knative.dev/networking v0.0.0-20230802091048-29da3ac7ef4d h1:v6vVLhZvUQXFaer8lpJvcE/YZGzkAjF7rXJNQMg9jnE= -knative.dev/networking v0.0.0-20230802091048-29da3ac7ef4d/go.mod h1:Vngl91M++hqgoGNIjCii7MXnsEeN3kRbGC1aodhFqbk= -knative.dev/pkg v0.0.0-20230802191948-8d3f95106327 h1:YvgaCUbXU7S9lJpm+Qh/z6LGiTSAWhyJLs5E/6dIx+8= -knative.dev/pkg v0.0.0-20230802191948-8d3f95106327/go.mod h1:iOH3bns9qjwY1/Ufq3/Vaqd+Lsk65b7yMFcWG3EriiI= -knative.dev/serving v0.38.1-0.20230803165821-8ea1cb621ae9 h1:HOncZYb39uFOcRpUOrzxFC6cUJLv0RyZiE961ItJ7aY= -knative.dev/serving v0.38.1-0.20230803165821-8ea1cb621ae9/go.mod h1:mgeEqBKeepzQRNDzSVBmRU9Xdm65nblUBZ+0MMAUkI8= +knative.dev/caching v0.0.0-20230807013813-53d98a451ff9 h1:G9x0yCvhnm8XwzhXXc2zd3tQY/EFGLS2ck5nWlvxPQ8= +knative.dev/caching v0.0.0-20230807013813-53d98a451ff9/go.mod h1:+LqreBMqWDEC7c07P/qJznFi1QuAXdaHj2gsjUFhLqs= +knative.dev/eventing v0.38.1-0.20230807061610-f614df300c6a h1:R6jXj+olDVjwaX0023uDrTsNcV9IPv/s7nC33xB3X+k= +knative.dev/eventing v0.38.1-0.20230807061610-f614df300c6a/go.mod h1:YcIvefg2DQq1e2nMWxXPrrDraR8kWfsQMvgirSAxVB0= +knative.dev/hack v0.0.0-20230807013713-a75befb4fd4b h1:hTzjunYC5vIXNG7zehR2CwdwIWrnaPIXNW5y190Xc34= +knative.dev/hack v0.0.0-20230807013713-a75befb4fd4b/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= +knative.dev/networking v0.0.0-20230803123221-e8f756206c6a h1:+JrOfYIlZxRaZmcCvVziBDOEGeOzTFzgRw5cqfu31Zk= +knative.dev/networking v0.0.0-20230803123221-e8f756206c6a/go.mod h1:EF09G7LzdsyeSeLxxk7mib3nO5nNuXfncPbj1TGVv4A= +knative.dev/pkg v0.0.0-20230807013311-7333c861d13b h1:8tEZKkw9P+IrYOaJ4eeoEBnlGjee2kDAcY5P0yfm26k= +knative.dev/pkg v0.0.0-20230807013311-7333c861d13b/go.mod h1:SX7XtdsppCsxVEiz0Af8UcDCtDoHcDMWQs3JshtdmwQ= +knative.dev/serving v0.38.1-0.20230807130311-0f27ffcb3cde h1:IHvCR0J1YFf528lORuxFYpi856Ms0y58UFJU/uWJx10= +knative.dev/serving v0.38.1-0.20230807130311-0f27ffcb3cde/go.mod h1:jsbTcnIebpZO5PVzalt9yZNcqVQJIULc5iNIvLemm1k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v1.0.0 h1:iQaM2w5PZ6xvt6x7hbd7tiDS+nk7YPp5uCaEba+T/F4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/knative.dev/eventing/test/e2e-common.sh b/vendor/knative.dev/eventing/test/e2e-common.sh index 687b3c1547..477a6741e5 100644 --- a/vendor/knative.dev/eventing/test/e2e-common.sh +++ b/vendor/knative.dev/eventing/test/e2e-common.sh @@ -72,6 +72,8 @@ readonly LATEST_RELEASE_VERSION=$(latest_version) readonly SKIP_UPLOAD_TEST_IMAGES="${SKIP_UPLOAD_TEST_IMAGES:-}" +readonly KAIL_VERSION=v0.16.1 + UNINSTALL_LIST=() # Setup the Knative environment for running tests. @@ -136,24 +138,27 @@ function build_knative_from_source() { # Parameters: $1 - Knative Eventing version "HEAD" or "latest-release". function install_knative_eventing() { echo ">> Creating ${SYSTEM_NAMESPACE} namespace if it does not exist" - kubectl get ns ${SYSTEM_NAMESPACE} || kubectl create namespace ${SYSTEM_NAMESPACE} + kubectl get ns "${SYSTEM_NAMESPACE}" || kubectl create namespace "${SYSTEM_NAMESPACE}" # Install Knative Eventing in the current cluster. echo "Installing Knative Eventing from: ${1}" if [[ "$1" == "HEAD" ]]; then build_knative_from_source local EVENTING_CORE_NAME=${TMP_DIR}/${EVENTING_CORE_YAML##*/} - sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" ${EVENTING_CORE_YAML} > ${EVENTING_CORE_NAME} + sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" "${EVENTING_CORE_YAML}" > "${EVENTING_CORE_NAME}" kubectl apply \ -f "${EVENTING_CORE_NAME}" || return 1 UNINSTALL_LIST+=( "${EVENTING_CORE_NAME}" ) - local EVENTING_TLS_NAME=${TMP_DIR}/${EVENTING_TLS_YAML##*/} - sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" ${EVENTING_TLS_YAML} > ${EVENTING_TLS_NAME} + local EVENTING_TLS_REPLACES=${TMP_DIR}/${EVENTING_TLS_YAML##*/} + sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" "${EVENTING_TLS_YAML}" > "${EVENTING_TLS_REPLACES}" + if [[ ! -z "${CLUSTER_SUFFIX:-}" ]]; then + sed -i "s/cluster.local/${CLUSTER_SUFFIX}/g" "${EVENTING_TLS_REPLACES}" + fi kubectl apply \ - -f "${EVENTING_TLS_NAME}" || return 1 - UNINSTALL_LIST+=( "${EVENTING_TLS_NAME}" ) + -f "${EVENTING_TLS_REPLACES}" || return 1 + UNINSTALL_LIST+=( "${EVENTING_TLS_REPLACES}" ) - kubectl patch horizontalpodautoscalers.autoscaling -n ${SYSTEM_NAMESPACE} eventing-webhook -p '{"spec": {"minReplicas": '${REPLICAS}'}}' || return 1 + kubectl patch horizontalpodautoscalers.autoscaling -n "${SYSTEM_NAMESPACE}" eventing-webhook -p '{"spec": {"minReplicas": '"${REPLICAS}"'}}' || return 1 else local EVENTING_RELEASE_YAML=${TMP_DIR}/"eventing-${LATEST_RELEASE_VERSION}.yaml" @@ -163,7 +168,7 @@ function install_knative_eventing() { || fail_test "Unable to download latest knative/eventing file." # Replace the default system namespace with the test's system namespace. - sed -i "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" ${EVENTING_RELEASE_YAML} + sed -i "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" "${EVENTING_RELEASE_YAML}" echo "Knative EVENTING YAML: ${EVENTING_RELEASE_YAML}" @@ -173,15 +178,15 @@ function install_knative_eventing() { # Setup config tracing for tracing tests local TMP_CONFIG_TRACING_CONFIG=${TMP_DIR}/${CONFIG_TRACING_CONFIG##*/} - sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" ${CONFIG_TRACING_CONFIG} > ${TMP_CONFIG_TRACING_CONFIG} - kubectl replace -f ${TMP_CONFIG_TRACING_CONFIG} + sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" "${CONFIG_TRACING_CONFIG}" > "${TMP_CONFIG_TRACING_CONFIG}" + kubectl replace -f "${TMP_CONFIG_TRACING_CONFIG}" scale_controlplane eventing-webhook eventing-controller - wait_until_pods_running ${SYSTEM_NAMESPACE} || fail_test "Knative Eventing did not come up" + wait_until_pods_running "${SYSTEM_NAMESPACE}" || fail_test "Knative Eventing did not come up" echo "check the config map" - kubectl get configmaps -n ${SYSTEM_NAMESPACE} + kubectl get configmaps -n "${SYSTEM_NAMESPACE}" if ! (( DEPLOY_KNATIVE_MONITORING )); then return 0; fi # Ensure knative monitoring is installed only once @@ -219,13 +224,13 @@ function install_mt_broker() { echo "use exist EVENTING_MT_CHANNEL_BROKER_YAML" fi local EVENTING_MT_CHANNEL_BROKER_NAME=${TMP_DIR}/${EVENTING_MT_CHANNEL_BROKER_YAML##*/} - sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" ${EVENTING_MT_CHANNEL_BROKER_YAML} > ${EVENTING_MT_CHANNEL_BROKER_NAME} + sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" "${EVENTING_MT_CHANNEL_BROKER_YAML}" > "${EVENTING_MT_CHANNEL_BROKER_NAME}" kubectl apply \ -f "${EVENTING_MT_CHANNEL_BROKER_NAME}" || return 1 UNINSTALL_LIST+=( "${EVENTING_MT_CHANNEL_BROKER_NAME}" ) scale_controlplane mt-broker-controller - wait_until_pods_running ${SYSTEM_NAMESPACE} || fail_test "Knative Eventing with MT Broker did not come up" + wait_until_pods_running "${SYSTEM_NAMESPACE}" || fail_test "Knative Eventing with MT Broker did not come up" } function enable_sugar() { @@ -234,7 +239,7 @@ function enable_sugar() { echo "enable sugar controller injection" cat test/config/sugar.yaml | \ sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" | \ - ko apply ${KO_FLAGS} -f - || return $? + ko apply "${KO_FLAGS}" -f - || return $? } function unleash_duck() { @@ -243,12 +248,12 @@ function unleash_duck() { echo "enable debug logging" cat test/config/config-logging.yaml | \ sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" | \ - ko apply ${KO_FLAGS} -f - || return $? + ko apply "${KO_FLAGS}" -f - || return $? echo "unleash the duck" cat test/config/chaosduck.yaml | \ sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" | \ - ko apply ${KO_FLAGS} -f - || return $? + ko apply "${KO_FLAGS}" -f - || return $? if (( SCALE_CHAOSDUCK_TO_ZERO )); then kubectl -n "${SYSTEM_NAMESPACE}" scale deployment/chaosduck --replicas=0; fi } @@ -274,10 +279,10 @@ function add_trap() { local cmd=$1 shift for trap_signal in $@; do - local current_trap="$(trap -p $trap_signal | cut -d\' -f2)" + local current_trap="$(trap -p "$trap_signal" | cut -d\' -f2)" local new_cmd="($cmd)" [[ -n "${current_trap}" ]] && new_cmd="${current_trap};${new_cmd}" - trap -- "${new_cmd}" $trap_signal + trap -- "${new_cmd}" "$trap_signal" done } @@ -287,11 +292,11 @@ function test_setup() { # Install kail if needed. if ! which kail >/dev/null; then - bash <(curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$GOPATH/bin" + go install github.com/boz/kail/cmd/kail@"${KAIL_VERSION}" fi # Capture all logs. - kail >${ARTIFACTS}/k8s.log.txt & + kail >"${ARTIFACTS}"/k8s.log.txt & local kail_pid=$! # Clean up kail so it doesn't interfere with job shutting down add_trap "kill $kail_pid || true" EXIT @@ -326,7 +331,7 @@ function install_channel_crds() { echo "use existing ${EVENTING_IN_MEMORY_CHANNEL_YAML}" fi local EVENTING_IN_MEMORY_CHANNEL_NAME=${TMP_DIR}/${EVENTING_IN_MEMORY_CHANNEL_YAML##*/} - sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" ${EVENTING_IN_MEMORY_CHANNEL_YAML} > ${EVENTING_IN_MEMORY_CHANNEL_NAME} + sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" "${EVENTING_IN_MEMORY_CHANNEL_YAML}" > "${EVENTING_IN_MEMORY_CHANNEL_NAME}" kubectl apply \ -f "${EVENTING_IN_MEMORY_CHANNEL_NAME}" || return 1 UNINSTALL_LIST+=( "${EVENTING_IN_MEMORY_CHANNEL_NAME}" ) @@ -334,7 +339,7 @@ function install_channel_crds() { # TODO(https://github.com/knative/eventing/issues/3590): Enable once IMC chaos issues are fixed. # scale_controlplane imc-controller imc-dispatcher - wait_until_pods_running ${SYSTEM_NAMESPACE} || fail_test "Failed to install the In-Memory Channel CRD" + wait_until_pods_running "${SYSTEM_NAMESPACE}" || fail_test "Failed to install the In-Memory Channel CRD" } function uninstall_channel_crds() { @@ -347,13 +352,13 @@ function dump_extra_cluster_state() { # Collecting logs from all knative's eventing pods. echo "============================================================" local namespace=${SYSTEM_NAMESPACE} - for pod in $(kubectl get pod -n $namespace | grep Running | awk '{print $1}'); do - for container in $(kubectl get pod "${pod}" -n $namespace -ojsonpath='{.spec.containers[*].name}'); do + for pod in $(kubectl get pod -n "$namespace" | grep Running | awk '{print $1}'); do + for container in $(kubectl get pod "${pod}" -n "$namespace" -ojsonpath='{.spec.containers[*].name}'); do echo "Namespace, Pod, Container: ${namespace}, ${pod}, ${container}" - kubectl logs -n $namespace "${pod}" -c "${container}" || true + kubectl logs -n "$namespace" "${pod}" -c "${container}" || true echo "----------------------------------------------------------" echo "Namespace, Pod, Container (Previous instance): ${namespace}, ${pod}, ${container}" - kubectl logs -p -n $namespace "${pod}" -c "${container}" || true + kubectl logs -p -n "$namespace" "${pod}" -c "${container}" || true echo "============================================================" done done diff --git a/vendor/modules.txt b/vendor/modules.txt index a3ead2bb79..885d061875 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1251,11 +1251,11 @@ k8s.io/utils/net k8s.io/utils/pointer k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/caching v0.0.0-20230803123121-79fe54161d98 +# knative.dev/caching v0.0.0-20230807013813-53d98a451ff9 ## explicit; go 1.18 knative.dev/caching/pkg/apis/caching knative.dev/caching/pkg/apis/caching/v1alpha1 -# knative.dev/eventing v0.38.1-0.20230803151922-0fd9aa16ec1e +# knative.dev/eventing v0.38.1-0.20230807061610-f614df300c6a ## explicit; go 1.19 knative.dev/eventing/pkg/apis/config knative.dev/eventing/pkg/apis/duck @@ -1344,11 +1344,11 @@ knative.dev/eventing/test/upgrade/prober/wathola/fetcher knative.dev/eventing/test/upgrade/prober/wathola/forwarder knative.dev/eventing/test/upgrade/prober/wathola/receiver knative.dev/eventing/test/upgrade/prober/wathola/sender -# knative.dev/hack v0.0.0-20230803220206-d7fde305c59f +# knative.dev/hack v0.0.0-20230807013713-a75befb4fd4b ## explicit; go 1.18 knative.dev/hack knative.dev/hack/shell -# knative.dev/networking v0.0.0-20230802091048-29da3ac7ef4d +# knative.dev/networking v0.0.0-20230803123221-e8f756206c6a ## explicit; go 1.18 knative.dev/networking/pkg knative.dev/networking/pkg/apis/networking @@ -1363,7 +1363,7 @@ knative.dev/networking/pkg/http/probe knative.dev/networking/pkg/http/proxy knative.dev/networking/pkg/http/stats knative.dev/networking/pkg/k8s -# knative.dev/pkg v0.0.0-20230802191948-8d3f95106327 +# knative.dev/pkg v0.0.0-20230807013311-7333c861d13b ## explicit; go 1.18 knative.dev/pkg/apiextensions/storageversion knative.dev/pkg/apiextensions/storageversion/cmd/migrate @@ -1443,7 +1443,7 @@ knative.dev/pkg/webhook knative.dev/pkg/webhook/certificates knative.dev/pkg/webhook/certificates/resources knative.dev/pkg/webhook/resourcesemantics/conversion -# knative.dev/serving v0.38.1-0.20230803165821-8ea1cb621ae9 +# knative.dev/serving v0.38.1-0.20230807130311-0f27ffcb3cde ## explicit; go 1.18 knative.dev/serving/pkg/apis/autoscaling knative.dev/serving/pkg/apis/autoscaling/v1alpha1