From 0d472f6bbd02256fc8f0d27e23145e7dab940c5d Mon Sep 17 00:00:00 2001 From: David Simansky Date: Thu, 18 Jan 2024 11:21:26 +0100 Subject: [PATCH 1/3] Enable storage of EventType v1b2 --- config/core/resources/eventtype.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/core/resources/eventtype.yaml b/config/core/resources/eventtype.yaml index 1bc820cb582..f17acc6499a 100644 --- a/config/core/resources/eventtype.yaml +++ b/config/core/resources/eventtype.yaml @@ -25,7 +25,7 @@ spec: - &version name: v1beta2 served: true - storage: false + storage: true subresources: status: {} schema: @@ -157,7 +157,7 @@ spec: - <<: *version name: v1beta1 served: true - storage: true + storage: false # This indicates the v1beta1 version of the custom resource is deprecated. # API requests to this version receive a warning header in the server response. deprecated: true From 72601ae5e6748bcd9cbed89f1f8fba7f0c686496 Mon Sep 17 00:00:00 2001 From: David Simansky Date: Thu, 18 Jan 2024 16:27:24 +0100 Subject: [PATCH 2/3] Add post install to setup --- test/e2e-common.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/e2e-common.sh b/test/e2e-common.sh index d0ff548b844..a2d67320467 100755 --- a/test/e2e-common.sh +++ b/test/e2e-common.sh @@ -149,6 +149,12 @@ function install_knative_eventing() { -f "${EVENTING_CORE_NAME}" || return 1 UNINSTALL_LIST+=( "${EVENTING_CORE_NAME}" ) + local EVENTING_POST_INSTALL_NAME=${TMP_DIR}/${EVENTING_POST_INSTALL_YAML##*/} + sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" "${EVENTING_POST_INSTALL_YAML}" > "${EVENTING_POST_INSTALL_NAME=}" + kubectl create \ + -f "${EVENTING_POST_INSTALL_NAME}" || return 1 + UNINSTALL_LIST+=( "${EVENTING_POST_INSTALL_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 From d30fa58a53158f4af556ae4f74980d97e3eccf4e Mon Sep 17 00:00:00 2001 From: David Simansky Date: Fri, 19 Jan 2024 09:36:15 +0100 Subject: [PATCH 3/3] Refactor post install to standalone function --- test/e2e-common.sh | 22 +++++++++++++++------- test/upgrade/installation/git_head.go | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/test/e2e-common.sh b/test/e2e-common.sh index a2d67320467..081bcf179e9 100755 --- a/test/e2e-common.sh +++ b/test/e2e-common.sh @@ -149,12 +149,6 @@ function install_knative_eventing() { -f "${EVENTING_CORE_NAME}" || return 1 UNINSTALL_LIST+=( "${EVENTING_CORE_NAME}" ) - local EVENTING_POST_INSTALL_NAME=${TMP_DIR}/${EVENTING_POST_INSTALL_YAML##*/} - sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" "${EVENTING_POST_INSTALL_YAML}" > "${EVENTING_POST_INSTALL_NAME=}" - kubectl create \ - -f "${EVENTING_POST_INSTALL_NAME}" || return 1 - UNINSTALL_LIST+=( "${EVENTING_POST_INSTALL_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 @@ -227,7 +221,7 @@ function install_mt_broker() { if [[ -z "${EVENTING_MT_CHANNEL_BROKER_YAML:-}" ]]; then build_knative_from_source else - echo "use exist EVENTING_MT_CHANNEL_BROKER_YAML" + echo "use existing 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}" @@ -239,6 +233,20 @@ function install_mt_broker() { wait_until_pods_running "${SYSTEM_NAMESPACE}" || fail_test "Knative Eventing with MT Broker did not come up" } +function install_post_install_job() { + # Var defined and populated by generate-yaml.sh + if [[ -z "${EVENTING_POST_INSTALL_YAML:-}" ]]; then + build_knative_from_source + else + echo "use existing EVENTING_POST_INSTALL_YAML" + fi + local EVENTING_POST_INSTALL_NAME=${TMP_DIR}/${EVENTING_POST_INSTALL_YAML##*/} + sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" "${EVENTING_POST_INSTALL_YAML}" > "${EVENTING_POST_INSTALL_NAME=}" + kubectl create \ + -f "${EVENTING_POST_INSTALL_NAME}" || return 1 + UNINSTALL_LIST+=( "${EVENTING_POST_INSTALL_NAME}" ) +} + function enable_sugar() { # Extra parameters for ko apply KO_FLAGS="${KO_FLAGS:-}" diff --git a/test/upgrade/installation/git_head.go b/test/upgrade/installation/git_head.go index f3378e0ff93..447c907ad3b 100644 --- a/test/upgrade/installation/git_head.go +++ b/test/upgrade/installation/git_head.go @@ -26,6 +26,7 @@ func GitHead() pkgupgrade.Operation { "install_head", "install_channel_crds", "install_mt_broker", + "install_post_install_job", "enable_sugar", } for _, shellfunc := range ops {