From b230fc02fb6ff345ece33fe89b16cd3de12dbcdb Mon Sep 17 00:00:00 2001 From: Haowei Cai Date: Wed, 27 Oct 2021 09:05:17 -0700 Subject: [PATCH] Update k8s API version if the old client was a snapshot --- scripts/release.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index a5e4dc6f3d..55b8a321ad 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -185,9 +185,12 @@ git commit -am "update version constants for $CLIENT_VERSION release" # TODO(roycaihw): not all Kubernetes API changes modify the OpenAPI spec. # Download the patch and skip if the spec is not modified. Also we want to # look at other k/k sections like "deprecation" -if [[ $CLIENT_VERSION == *"snapshot"* ]]; then - # Update "Kubernetes API Version" if we are generating a snapshot +if [[ $old_client_version == *"snapshot"* ]]; then + # If the old client version was a snapshot, update the changelog in place util::changelog::update_release_api_version $CLIENT_VERSION $old_client_version $new_k8s_api_version +else + # Otherwise add a new section in the changelog + util::changelog::update_release_api_version $CLIENT_VERSION $CLIENT_VERSION $new_k8s_api_version fi release_notes=$(util::kube_changelog::get_api_changelog "$KUBERNETES_BRANCH" "$old_k8s_api_version") if [[ -n "$release_notes" ]]; then