From 0130240adf289517709edcbfadfa0e8c557966e5 Mon Sep 17 00:00:00 2001 From: Vincent Hou Date: Tue, 21 Apr 2020 15:56:40 -0400 Subject: [PATCH 1/4] Remove the redundant resources in channel-broker and mt-channel-broker --- hack/release.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hack/release.sh b/hack/release.sh index 82d5618cfd4..f2ee503c7ce 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -22,12 +22,12 @@ source $(dirname $0)/../vendor/knative.dev/test-infra/scripts/release.sh # Yaml files to generate, and the source config dir for them. declare -A COMPONENTS COMPONENTS=( - ["eventing-core.yaml"]="config/core" - ["eventing-crds.yaml"]="config/core/resources" - ["channel-broker.yaml"]="config/brokers/channel-broker" - ["mt-channel-broker.yaml"]="config/brokers/mt-channel-broker" - ["in-memory-channel.yaml"]="config/channels/in-memory-channel" - ["upgrade-to-v0.14.0.yaml"]="config/upgrade/v0.14.0" + ["eventing-core.yaml"]="-R -f config/core" + ["eventing-crds.yaml"]="-f config/core/resources" + ["channel-broker.yaml"]="-f config/brokers/channel-broker" + ["mt-channel-broker.yaml"]="-f config/brokers/mt-channel-broker" + ["in-memory-channel.yaml"]="-f config/channels/in-memory-channel" + ["upgrade-to-v0.14.0.yaml"]="-f config/upgrade/v0.14.0" ) readonly COMPONENTS @@ -53,7 +53,7 @@ function build_release() { local config="${COMPONENTS[${yaml}]}" echo "Building Knative Eventing - ${config}" # TODO(chizhg): reenable --strict mode after https://github.com/knative/test-infra/issues/1262 is fixed. - ko resolve ${KO_FLAGS} -R -f ${config}/ | "${LABEL_YAML_CMD[@]}" > ${yaml} + ko resolve ${KO_FLAGS} ${config}/ | "${LABEL_YAML_CMD[@]}" > ${yaml} all_yamls+=(${yaml}) done # Assemble the release From f5686836256d1b2033148e00d53c3ade8c81af5d Mon Sep 17 00:00:00 2001 From: Vincent Hou Date: Wed, 22 Apr 2020 09:56:43 -0400 Subject: [PATCH 2/4] Change the structure of the release.sh --- hack/release.sh | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/hack/release.sh b/hack/release.sh index f2ee503c7ce..8352363a9d8 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -19,21 +19,16 @@ source $(dirname $0)/../vendor/knative.dev/test-infra/scripts/release.sh -# Yaml files to generate, and the source config dir for them. -declare -A COMPONENTS -COMPONENTS=( - ["eventing-core.yaml"]="-R -f config/core" - ["eventing-crds.yaml"]="-f config/core/resources" - ["channel-broker.yaml"]="-f config/brokers/channel-broker" - ["mt-channel-broker.yaml"]="-f config/brokers/mt-channel-broker" - ["in-memory-channel.yaml"]="-f config/channels/in-memory-channel" - ["upgrade-to-v0.14.0.yaml"]="-f config/upgrade/v0.14.0" -) -readonly COMPONENTS +readonly EVENTING_CORE_YAML="eventing-core.yaml" +readonly EVENTING_CRDS_YAML="eventing-crds.yaml" +readonly CHANNEL_BROKER_YAML="channel-broker.yaml" +readonly MT_CHANNEL_BROKER_YAML="mt-channel-broker.yaml" +readonly IN_MEMORY_CHANNEL="in-memory-channel.yaml" +readonly UPGRADE_TO_V14="upgrade-to-v0.14.yaml" declare -A RELEASES RELEASES=( - ["eventing.yaml"]="eventing-core.yaml channel-broker.yaml mt-channel-broker.yaml in-memory-channel.yaml" + ["eventing.yaml"]="${EVENTING_CORE_YAML} ${CHANNEL_BROKER_YAML} ${MT_CHANNEL_BROKER_YAML} ${IN_MEMORY_CHANNEL}" ) readonly RELEASES @@ -48,14 +43,26 @@ function build_release() { fi # Build the components - local all_yamls=() - for yaml in "${!COMPONENTS[@]}"; do - local config="${COMPONENTS[${yaml}]}" - echo "Building Knative Eventing - ${config}" - # TODO(chizhg): reenable --strict mode after https://github.com/knative/test-infra/issues/1262 is fixed. - ko resolve ${KO_FLAGS} ${config}/ | "${LABEL_YAML_CMD[@]}" > ${yaml} - all_yamls+=(${yaml}) - done + echo "Building Knative Eventing" + # Create eventing core yaml + ko resolve ${KO_FLAGS} -R -f config/core/ | "${LABEL_YAML_CMD[@]}" > "${EVENTING_CORE_YAML}" + + # Create eventing crds yaml + ko resolve ${KO_FLAGS} -f config/core/resources/ | "${LABEL_YAML_CMD[@]}" > "${EVENTING_CRDS_YAML}" + + # Create channel broker yaml + ko resolve ${KO_FLAGS} -f config/brokers/channel-broker/ | "${LABEL_YAML_CMD[@]}" > "${CHANNEL_BROKER_YAML}" + + # Create mt channel broker yaml + ko resolve ${KO_FLAGS} -f config/brokers/mt-channel-broker/ | "${LABEL_YAML_CMD[@]}" > "${MT_CHANNEL_BROKER_YAML}" + + # Create in memory channel yaml + ko resolve ${KO_FLAGS} -f config/channels/in-memory-channel/ | "${LABEL_YAML_CMD[@]}" > "${IN_MEMORY_CHANNEL}" + + # Create upgrade job yaml + ko resolve ${KO_FLAGS} -f config/upgrade/v0.14.0/ | "${LABEL_YAML_CMD[@]}" > "${UPGRADE_TO_V14}" + + local all_yamls=(${EVENTING_CORE_YAML} ${EVENTING_CRDS_YAML} ${CHANNEL_BROKER_YAML} ${MT_CHANNEL_BROKER_YAML} ${IN_MEMORY_CHANNEL} ${UPGRADE_TO_V14}) # Assemble the release for yaml in "${!RELEASES[@]}"; do echo "Assembling Knative Eventing - ${yaml}" From 8b8e81222f74ca4959936606feb70276d6ff9e77 Mon Sep 17 00:00:00 2001 From: Vincent Hou Date: Wed, 22 Apr 2020 09:59:11 -0400 Subject: [PATCH 3/4] Rename the directory of upgrade job --- config/upgrade/{v0.14.0 => v0.14}/README.md | 0 config/upgrade/{v0.14.0 => v0.14}/upgrade.yaml | 0 hack/release.sh | 7 ++++--- 3 files changed, 4 insertions(+), 3 deletions(-) rename config/upgrade/{v0.14.0 => v0.14}/README.md (100%) rename config/upgrade/{v0.14.0 => v0.14}/upgrade.yaml (100%) diff --git a/config/upgrade/v0.14.0/README.md b/config/upgrade/v0.14/README.md similarity index 100% rename from config/upgrade/v0.14.0/README.md rename to config/upgrade/v0.14/README.md diff --git a/config/upgrade/v0.14.0/upgrade.yaml b/config/upgrade/v0.14/upgrade.yaml similarity index 100% rename from config/upgrade/v0.14.0/upgrade.yaml rename to config/upgrade/v0.14/upgrade.yaml diff --git a/hack/release.sh b/hack/release.sh index 8352363a9d8..55585bbca64 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -24,7 +24,6 @@ readonly EVENTING_CRDS_YAML="eventing-crds.yaml" readonly CHANNEL_BROKER_YAML="channel-broker.yaml" readonly MT_CHANNEL_BROKER_YAML="mt-channel-broker.yaml" readonly IN_MEMORY_CHANNEL="in-memory-channel.yaml" -readonly UPGRADE_TO_V14="upgrade-to-v0.14.yaml" declare -A RELEASES RELEASES=( @@ -40,8 +39,10 @@ function build_release() { else echo "Untagged release, will NOT update release labels" LABEL_YAML_CMD=(cat) + TAG="latest" fi + readonly UPGRADE_JOB="upgrade-to-${TAG}.yaml" # Build the components echo "Building Knative Eventing" # Create eventing core yaml @@ -60,9 +61,9 @@ function build_release() { ko resolve ${KO_FLAGS} -f config/channels/in-memory-channel/ | "${LABEL_YAML_CMD[@]}" > "${IN_MEMORY_CHANNEL}" # Create upgrade job yaml - ko resolve ${KO_FLAGS} -f config/upgrade/v0.14.0/ | "${LABEL_YAML_CMD[@]}" > "${UPGRADE_TO_V14}" + ko resolve ${KO_FLAGS} -f config/upgrade/v0.14/ | "${LABEL_YAML_CMD[@]}" > "${UPGRADE_JOB}" - local all_yamls=(${EVENTING_CORE_YAML} ${EVENTING_CRDS_YAML} ${CHANNEL_BROKER_YAML} ${MT_CHANNEL_BROKER_YAML} ${IN_MEMORY_CHANNEL} ${UPGRADE_TO_V14}) + local all_yamls=(${EVENTING_CORE_YAML} ${EVENTING_CRDS_YAML} ${CHANNEL_BROKER_YAML} ${MT_CHANNEL_BROKER_YAML} ${IN_MEMORY_CHANNEL} ${UPGRADE_JOB}) # Assemble the release for yaml in "${!RELEASES[@]}"; do echo "Assembling Knative Eventing - ${yaml}" From 06ced67e2f81e3d1895d08133f7d3d5a9bf5afd2 Mon Sep 17 00:00:00 2001 From: Vincent Hou Date: Mon, 27 Apr 2020 09:31:42 -0400 Subject: [PATCH 4/4] Keep the upgrade 0.14.0 unchanged --- config/upgrade/{v0.14 => v0.14.0}/README.md | 0 config/upgrade/{v0.14 => v0.14.0}/upgrade.yaml | 0 hack/release.sh | 5 ++--- 3 files changed, 2 insertions(+), 3 deletions(-) rename config/upgrade/{v0.14 => v0.14.0}/README.md (100%) rename config/upgrade/{v0.14 => v0.14.0}/upgrade.yaml (100%) diff --git a/config/upgrade/v0.14/README.md b/config/upgrade/v0.14.0/README.md similarity index 100% rename from config/upgrade/v0.14/README.md rename to config/upgrade/v0.14.0/README.md diff --git a/config/upgrade/v0.14/upgrade.yaml b/config/upgrade/v0.14.0/upgrade.yaml similarity index 100% rename from config/upgrade/v0.14/upgrade.yaml rename to config/upgrade/v0.14.0/upgrade.yaml diff --git a/hack/release.sh b/hack/release.sh index 55585bbca64..ca8663a500d 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -24,6 +24,7 @@ readonly EVENTING_CRDS_YAML="eventing-crds.yaml" readonly CHANNEL_BROKER_YAML="channel-broker.yaml" readonly MT_CHANNEL_BROKER_YAML="mt-channel-broker.yaml" readonly IN_MEMORY_CHANNEL="in-memory-channel.yaml" +readonly UPGRADE_JOB="upgrade-to-v0.14.0.yaml" declare -A RELEASES RELEASES=( @@ -39,10 +40,8 @@ function build_release() { else echo "Untagged release, will NOT update release labels" LABEL_YAML_CMD=(cat) - TAG="latest" fi - readonly UPGRADE_JOB="upgrade-to-${TAG}.yaml" # Build the components echo "Building Knative Eventing" # Create eventing core yaml @@ -61,7 +60,7 @@ function build_release() { ko resolve ${KO_FLAGS} -f config/channels/in-memory-channel/ | "${LABEL_YAML_CMD[@]}" > "${IN_MEMORY_CHANNEL}" # Create upgrade job yaml - ko resolve ${KO_FLAGS} -f config/upgrade/v0.14/ | "${LABEL_YAML_CMD[@]}" > "${UPGRADE_JOB}" + ko resolve ${KO_FLAGS} -f config/upgrade/v0.14.0/ | "${LABEL_YAML_CMD[@]}" > "${UPGRADE_JOB}" local all_yamls=(${EVENTING_CORE_YAML} ${EVENTING_CRDS_YAML} ${CHANNEL_BROKER_YAML} ${MT_CHANNEL_BROKER_YAML} ${IN_MEMORY_CHANNEL} ${UPGRADE_JOB}) # Assemble the release