From 08ee43f3ab6af19aac8470fc339b4c400bbcab82 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Tue, 4 Nov 2025 11:14:53 +0100 Subject: [PATCH 1/9] update application-release_name to be maximum 51 chars long --- README.md | 20 ++++++------- scripts/generate-releases.sh | 58 +++++++++++++++++++++++++----------- 2 files changed, 51 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index e705dbab..aa0a31f2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ACS Operator Index -This repository is for building and releasing the ACS operator indexes on Konflux. +This repository is for building and releasing the ACS operator indexes on Konflux. It's for updating Operator Catalogs, i.e., so OpenShift clusters can see new versions of ACS operator in their OperatorHub. @@ -17,7 +17,7 @@ Do the following changes in the `catalog-template.yaml` file. 1. Add bundle image. 1. Find entries with `schema: olm.bundle` towards the end of the file. - 2. Add a new entry for your bundle image. + 2. Add a new entry for your bundle image. It should look something like this: ```yaml - schema: olm.bundle @@ -28,7 +28,7 @@ Do the following changes in the `catalog-template.yaml` file. * Keep entries sorted according to version. * Add a comment stating the version, see how it's done for other items there. * You may add bundle images from `quay.io`, `brew.registry.redhat.io` and so on (provided they exist and are - pullable) during development and/or when preparing to release. + pullable) during development and/or when preparing to release. Ultimately, all released bundle images must come from `registry.redhat.io/advanced-cluster-security/rhacs-operator-bundle` repo because this is where customers expect to find them. There's a CI check which prevents pushing to `master` if there's any bundle from @@ -56,8 +56,8 @@ Do the following changes in the `catalog-template.yaml` file. after `4.8.1`, that'd be `8` and `1`; when you add `4.9.0` after `4.8.3`, that'd be `8` and `3`), * `(Y-1)` with the value of `Y` minus 1 (e.g., when you add `4.8.2`, that'd be `7`). 3. If the item you added is not the last one in the `entries` list, i.e., not the highest version, adjust the next - item in the `entries` list. - Set its `replaces:` to be `rhacs-operator.v4.Y.Z`. + item in the `entries` list. + Set its `replaces:` to be `rhacs-operator.v4.Y.Z`. For example: ```yaml - &bundle-4-7-4 # <-------- this was already there @@ -132,16 +132,16 @@ See [konflux docs](https://github.com/konflux-ci/build-definitions/blob/c93ea73d 1. Make sure you [logged in](https://spaces.redhat.com/pages/viewpage.action?pageId=407312060#HowtoeverythingKonfluxforRHACS-GettingocCLItoworkwithKonflux) to the Konflux cluster. 2. Make sure you checked out the latest master branch: `git checkout master && git pull` -3. Generate Release and Snapshot CRs by running `./scripts/generate-releases.sh `. Use `staging` for test release and `prod` for production one. -4. (Skip for `staging` release.) Create a PR which adds the file created by the script, get the PR reviewed and merged. -5. (Skip for `staging` release.) Go to the [#acs-operator-index-release](https://redhat.enterprise.slack.com/archives/C096WU0GZUG) channel, and: +3. Generate Release and Snapshot CRs by running `./scripts/generate-releases.sh `. Use `stage` for test release and `prod` for production one. +4. (Skip for `stage` release.) Create a PR which adds the file created by the script, get the PR reviewed and merged. +5. (Skip for `stage` release.) Go to the [#acs-operator-index-release](https://redhat.enterprise.slack.com/archives/C096WU0GZUG) channel, and: 1. make sure the previous operator index release is complete (has a green check mark emoticon) 2. if not, coordinate with the person conducting that release 3. once that release is complete, start a new thread for your release -6. Apply generated CRs to the cluster: `oc create -f release-history/--.yaml` +6. Apply generated CRs to the cluster: `oc create -f release-history/--.yaml` 7. Monitor release [using monitor release script](#monitoring-release). Each supported OCP version has its own `Release`. Successfully finished `Release` has `Succeeded` status. 8. Follow [the restarting release step below](#restarting-konflux-release) if any of the `Release`s fails for any OCP version. -9. (Skip for `staging` release.) Once done, go back to the Slack thread you started earlier, add a message that your release is done and add a green check mark emoticon on the initial message of the thread. +9. (Skip for `stage` release.) Once done, go back to the Slack thread you started earlier, add a message that your release is done and add a green check mark emoticon on the initial message of the thread. 10. Once releases for all OCP versions successfully finish, then the operator catalog release is done. If you perform it as part of a bigger release procedure, you should go back to that procedure and continue with further steps. diff --git a/scripts/generate-releases.sh b/scripts/generate-releases.sh index 235052ba..53985668 100755 --- a/scripts/generate-releases.sh +++ b/scripts/generate-releases.sh @@ -39,7 +39,7 @@ usage() { if [[ "$#" -lt 1 || "$#" -gt 3 || "${1:-}" == "--help" ]]; then echo "USAGE: ./$(basename "${BASH_SOURCE[0]}") [COMMIT] [BRANCH]" >&2 echo "" >&2 - echo "ENVIRONMENT - allowed values: staging|prod" >&2 + echo "ENVIRONMENT - allowed values: stage|prod" >&2 echo "COMMIT - a SHA of the commit to pull Snapshots only with this commit label for the Release." >&2 echo "If provided commit SHA is less than 40 characters then it will be expanded to a full 40-characters long SHA. Default: currently checked out commit" >&2 echo "BRANCH - an optional parameter to specify git branch name for filtering snapshots by having branch name in annotations. Default: currently checked out branch" >&2 @@ -49,12 +49,12 @@ usage() { fi } -# Validate environment input and ensure it is either 'staging' or 'prod' (for master branch only). +# Validate environment input and ensure it is either 'stage' or 'prod' (for master branch only). validate_environment() { local -r environment="$1" local -r branch="$2" - if [[ "${environment}" != "staging" && "${environment}" != "prod" ]]; then - echo "ERROR: ENVIRONMENT input must either be 'staging' or 'prod'." >&2 + if [[ "${environment}" != "stage" && "${environment}" != "prod" ]]; then + echo "ERROR: ENVIRONMENT input must either be 'stage' or 'prod'." >&2 return 1 fi if [[ "${environment}" == "prod" && "${branch}" != "master" ]]; then @@ -94,6 +94,19 @@ validate_snapshots() { fi } +validate_release_name_length() { + # Validate release name length. + # To allow for Konflux' re-run suffix (12 chars), it must be at most 51 characters long. + # Otherwise, the re-run release will fail to be created as the name would exceed the Kubernetes limit of 63 characters. + local -r release_name_with_application="$1" + + if [[ ${#release_name_with_application} -gt 51 ]]; then + echo "ERROR: Generated release name '${release_name_with_application}' is ${#release_name_with_application} characters long, which exceeds the 51 character limit." >&2 + echo "You must update the script to generate a shorter release name." >&2 + exit 1 + fi +} + # Generate the Release resources for each snapshot found. generate_release_resources() { local -r environment="$1" @@ -105,19 +118,19 @@ generate_release_resources() { local application local release_plan - case ${environment} in - staging) - env_short=stg - ;; - prod) - env_short=prd - ;; - esac - - release_name="$(date +"%Y-%m-%d")-$(git rev-parse --short "$commit")-${environment}" - release_name_short="$(date +"%Y%m%d")-$(git rev-parse --short "$commit")-${env_short}" # save space for retry suffix + release_name="$(date +"%Y%m%d")-$(git rev-parse --short=7 "$commit")-${environment}" whitelist_file="$ROOT_DIR/release-history/.whitelist.yaml" out_file="$ROOT_DIR/release-history/${release_name}.yaml" + + # Pre-validate all release names before writing anything to the output file + echo "Validating release names..." >&2 + while IFS= read -r line + do + application="$(echo "$line" | cut -d "|" -f 2)" + release_name_with_application="${application}-${release_name}" + validate_release_name_length "$release_name_with_application" + done <<< "$snapshots_data" + echo "Writing resources to ${out_file} ..." >&2 while IFS= read -r line do @@ -140,13 +153,24 @@ generate_release_resources() { }' application="$(echo "$line" | cut -d "|" -f 2)" - release_plan="${application/acs-operator-index/acs-operator-index-${environment}}" + release_name_with_application="${application}-${release_name}" + + if [[ "${environment}" == "stage" ]]; then + # The release plan for stage is suffixed with "-staging" + # TODO: rename release plans? + # All references in https://konflux.pages.redhat.com/docs/users/releasing/preparing-for-release.html point to pre-prod environments as "stage". + release_plan="${application/acs-operator-index/acs-operator-index-staging}" + else + # The release plan for prod is suffixed with "-prod" + release_plan="${application/acs-operator-index/acs-operator-index-${environment}}" + fi + sed -E 's/^[[:blank:]]{8}//' <<<" --- apiVersion: appstudio.redhat.com/v1alpha1 kind: Release metadata: - name: ${application}-${release_name_short} + name: ${release_name_with_application} namespace: rh-acs-tenant spec: releasePlan: ${release_plan} From c284843cf3cc918260dec78635cc663f33193505 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Tue, 4 Nov 2025 11:23:40 +0100 Subject: [PATCH 2/9] self-review --- scripts/generate-releases.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/generate-releases.sh b/scripts/generate-releases.sh index 53985668..d0b154d5 100755 --- a/scripts/generate-releases.sh +++ b/scripts/generate-releases.sh @@ -95,9 +95,8 @@ validate_snapshots() { } validate_release_name_length() { - # Validate release name length. # To allow for Konflux' re-run suffix (12 chars), it must be at most 51 characters long. - # Otherwise, the re-run release will fail to be created as the name would exceed the Kubernetes limit of 63 characters. + # Otherwise, the re-run Release CR will fail to be created as the name would exceed the Kubernetes limit of 63 characters. local -r release_name_with_application="$1" if [[ ${#release_name_with_application} -gt 51 ]]; then @@ -128,7 +127,7 @@ generate_release_resources() { do application="$(echo "$line" | cut -d "|" -f 2)" release_name_with_application="${application}-${release_name}" - validate_release_name_length "$release_name_with_application" + validate_release_name_length "${release_name_with_application}" done <<< "$snapshots_data" echo "Writing resources to ${out_file} ..." >&2 From d05f9c32f1c41352b40e6d6710ec9ba91e178440 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Tue, 4 Nov 2025 11:27:44 +0100 Subject: [PATCH 3/9] restore the line breaks in the README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index aa0a31f2..9aef4a8a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ACS Operator Index -This repository is for building and releasing the ACS operator indexes on Konflux. +This repository is for building and releasing the ACS operator indexes on Konflux.\ It's for updating Operator Catalogs, i.e., so OpenShift clusters can see new versions of ACS operator in their OperatorHub. @@ -17,7 +17,7 @@ Do the following changes in the `catalog-template.yaml` file. 1. Add bundle image. 1. Find entries with `schema: olm.bundle` towards the end of the file. - 2. Add a new entry for your bundle image. + 2. Add a new entry for your bundle image.\ It should look something like this: ```yaml - schema: olm.bundle @@ -28,7 +28,7 @@ Do the following changes in the `catalog-template.yaml` file. * Keep entries sorted according to version. * Add a comment stating the version, see how it's done for other items there. * You may add bundle images from `quay.io`, `brew.registry.redhat.io` and so on (provided they exist and are - pullable) during development and/or when preparing to release. + pullable) during development and/or when preparing to release.\ Ultimately, all released bundle images must come from `registry.redhat.io/advanced-cluster-security/rhacs-operator-bundle` repo because this is where customers expect to find them. There's a CI check which prevents pushing to `master` if there's any bundle from @@ -56,8 +56,8 @@ Do the following changes in the `catalog-template.yaml` file. after `4.8.1`, that'd be `8` and `1`; when you add `4.9.0` after `4.8.3`, that'd be `8` and `3`), * `(Y-1)` with the value of `Y` minus 1 (e.g., when you add `4.8.2`, that'd be `7`). 3. If the item you added is not the last one in the `entries` list, i.e., not the highest version, adjust the next - item in the `entries` list. - Set its `replaces:` to be `rhacs-operator.v4.Y.Z`. + item in the `entries` list.\ + Set its `replaces:` to be `rhacs-operator.v4.Y.Z`.\ For example: ```yaml - &bundle-4-7-4 # <-------- this was already there From b6926eb748a407c66ebd7354e6cf363b1d79985a Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Tue, 4 Nov 2025 16:07:46 +0100 Subject: [PATCH 4/9] remove workaround for staging RP, assume stage RP --- scripts/generate-releases.sh | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/scripts/generate-releases.sh b/scripts/generate-releases.sh index d0b154d5..a7a729a0 100755 --- a/scripts/generate-releases.sh +++ b/scripts/generate-releases.sh @@ -153,16 +153,7 @@ generate_release_resources() { application="$(echo "$line" | cut -d "|" -f 2)" release_name_with_application="${application}-${release_name}" - - if [[ "${environment}" == "stage" ]]; then - # The release plan for stage is suffixed with "-staging" - # TODO: rename release plans? - # All references in https://konflux.pages.redhat.com/docs/users/releasing/preparing-for-release.html point to pre-prod environments as "stage". - release_plan="${application/acs-operator-index/acs-operator-index-staging}" - else - # The release plan for prod is suffixed with "-prod" - release_plan="${application/acs-operator-index/acs-operator-index-${environment}}" - fi + release_plan="${application/acs-operator-index/acs-operator-index-${environment}}" sed -E 's/^[[:blank:]]{8}//' <<<" --- From b7760665e3944f2e96cca73e6b952e8fb3802029 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Tue, 4 Nov 2025 16:36:03 +0100 Subject: [PATCH 5/9] rename to release_name_suffix and add more comments --- scripts/generate-releases.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/generate-releases.sh b/scripts/generate-releases.sh index a7a729a0..8dd0c008 100755 --- a/scripts/generate-releases.sh +++ b/scripts/generate-releases.sh @@ -94,9 +94,10 @@ validate_snapshots() { fi } +# Validate the length of the release name. +# To allow for Konflux' re-run suffix (12 chars), the full release name must be at most 51 characters long. +# Otherwise, the re-run Release CR will fail to be created as its name would exceed the Kubernetes limit of 63 characters. validate_release_name_length() { - # To allow for Konflux' re-run suffix (12 chars), it must be at most 51 characters long. - # Otherwise, the re-run Release CR will fail to be created as the name would exceed the Kubernetes limit of 63 characters. local -r release_name_with_application="$1" if [[ ${#release_name_with_application} -gt 51 ]]; then @@ -112,21 +113,21 @@ generate_release_resources() { local -r commit="$2" local -r snapshots_data="$3" - local release_name + local release_name_suffix local snapshot local application local release_plan - release_name="$(date +"%Y%m%d")-$(git rev-parse --short=7 "$commit")-${environment}" + release_name_suffix="$(date +"%Y%m%d")-$(git rev-parse --short=7 "$commit")-${environment}" whitelist_file="$ROOT_DIR/release-history/.whitelist.yaml" - out_file="$ROOT_DIR/release-history/${release_name}.yaml" + out_file="$ROOT_DIR/release-history/${release_name_suffix}.yaml" # Pre-validate all release names before writing anything to the output file echo "Validating release names..." >&2 while IFS= read -r line do application="$(echo "$line" | cut -d "|" -f 2)" - release_name_with_application="${application}-${release_name}" + release_name_with_application="${application}-${release_name_suffix}" validate_release_name_length "${release_name_with_application}" done <<< "$snapshots_data" @@ -134,7 +135,7 @@ generate_release_resources() { while IFS= read -r line do snapshot="$(echo "$line" | cut -d "|" -f 1)" - snapshot_copy="${snapshot%-*}-${release_name}" # replace random suffix with release name + snapshot_copy="${snapshot%-*}-${release_name_suffix}" # replace random suffix with release name echo "---" kubectl -n rh-acs-tenant get snapshot.appstudio.redhat.com "${snapshot}" -o yaml | \ "${YQ}" -P 'load("'"${whitelist_file}"'") as $whitelisted @@ -152,7 +153,7 @@ generate_release_resources() { }' application="$(echo "$line" | cut -d "|" -f 2)" - release_name_with_application="${application}-${release_name}" + release_name_with_application="${application}-${release_name_suffix}" release_plan="${application/acs-operator-index/acs-operator-index-${environment}}" sed -E 's/^[[:blank:]]{8}//' <<<" From 409ff0b945ad79811020e281cc09b82020848111 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Mon, 10 Nov 2025 11:25:28 +0100 Subject: [PATCH 6/9] rename variable: snapshot_copy -> snapshot_copy_name --- scripts/generate-releases.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/generate-releases.sh b/scripts/generate-releases.sh index 8dd0c008..924a6f93 100755 --- a/scripts/generate-releases.sh +++ b/scripts/generate-releases.sh @@ -135,7 +135,7 @@ generate_release_resources() { while IFS= read -r line do snapshot="$(echo "$line" | cut -d "|" -f 1)" - snapshot_copy="${snapshot%-*}-${release_name_suffix}" # replace random suffix with release name + snapshot_copy_name="${snapshot%-*}-${release_name_suffix}" # replace random suffix with release name echo "---" kubectl -n rh-acs-tenant get snapshot.appstudio.redhat.com "${snapshot}" -o yaml | \ "${YQ}" -P 'load("'"${whitelist_file}"'") as $whitelisted @@ -146,7 +146,7 @@ generate_release_resources() { "metadata": { "annotations": .metadata.annotations + {"acs.redhat.com/original-snapshot-name": "'"${snapshot}"'"}, "labels": .metadata.labels, - "name": "'"${snapshot_copy}"'", + "name": "'"${snapshot_copy_name}"'", "namespace": .metadata.namespace }, "spec": .spec @@ -165,7 +165,7 @@ generate_release_resources() { namespace: rh-acs-tenant spec: releasePlan: ${release_plan} - snapshot: ${snapshot_copy}" + snapshot: ${snapshot_copy_name}" done <<< "$snapshots_data" > "${out_file}" From 6d18fe505a73810c343fd86405372467fa39e33d Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Mon, 10 Nov 2025 11:33:24 +0100 Subject: [PATCH 7/9] crop release name strictly --- scripts/generate-releases.sh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/scripts/generate-releases.sh b/scripts/generate-releases.sh index 924a6f93..c202371e 100755 --- a/scripts/generate-releases.sh +++ b/scripts/generate-releases.sh @@ -118,19 +118,10 @@ generate_release_resources() { local application local release_plan - release_name_suffix="$(date +"%Y%m%d")-$(git rev-parse --short=7 "$commit")-${environment}" + release_name_suffix="$(date +"%Y%m%d")-${environment}-$(git rev-parse "$commit")" whitelist_file="$ROOT_DIR/release-history/.whitelist.yaml" out_file="$ROOT_DIR/release-history/${release_name_suffix}.yaml" - # Pre-validate all release names before writing anything to the output file - echo "Validating release names..." >&2 - while IFS= read -r line - do - application="$(echo "$line" | cut -d "|" -f 2)" - release_name_with_application="${application}-${release_name_suffix}" - validate_release_name_length "${release_name_with_application}" - done <<< "$snapshots_data" - echo "Writing resources to ${out_file} ..." >&2 while IFS= read -r line do @@ -153,7 +144,9 @@ generate_release_resources() { }' application="$(echo "$line" | cut -d "|" -f 2)" - release_name_with_application="${application}-${release_name_suffix}" + + # Crop the release name to 51 characters to avoid the Kubernetes limit of 63 characters for re-runs. + release_name_with_application="$(echo "${application}-${release_name_suffix}" | cut -c -51)" release_plan="${application/acs-operator-index/acs-operator-index-${environment}}" sed -E 's/^[[:blank:]]{8}//' <<<" From 8604e1b8be74ba46762a5c4148ee88ecdf6124b2 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Mon, 10 Nov 2025 13:17:21 +0100 Subject: [PATCH 8/9] apply review suggestions --- scripts/generate-releases.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate-releases.sh b/scripts/generate-releases.sh index c202371e..fa2e9dc4 100755 --- a/scripts/generate-releases.sh +++ b/scripts/generate-releases.sh @@ -118,7 +118,7 @@ generate_release_resources() { local application local release_plan - release_name_suffix="$(date +"%Y%m%d")-${environment}-$(git rev-parse "$commit")" + release_name_suffix="$(date +"%Y%m%d")-${environment}-$(git rev-parse --short "$commit")" whitelist_file="$ROOT_DIR/release-history/.whitelist.yaml" out_file="$ROOT_DIR/release-history/${release_name_suffix}.yaml" @@ -126,7 +126,7 @@ generate_release_resources() { while IFS= read -r line do snapshot="$(echo "$line" | cut -d "|" -f 1)" - snapshot_copy_name="${snapshot%-*}-${release_name_suffix}" # replace random suffix with release name + snapshot_copy_name="$(echo "${snapshot%-*}-${release_name_suffix}" | cut -c -51)" # replace random suffix with release name and crop to 63 characters to avoid the Kubernetes limit. echo "---" kubectl -n rh-acs-tenant get snapshot.appstudio.redhat.com "${snapshot}" -o yaml | \ "${YQ}" -P 'load("'"${whitelist_file}"'") as $whitelisted From eb7a6ebbdf0e6f5242eee64db0a27b2969d28b53 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Tue, 11 Nov 2025 10:23:09 +0100 Subject: [PATCH 9/9] Apply suggestions from code review Co-authored-by: Misha Sugakov <537715+msugakov@users.noreply.github.com> --- README.md | 2 +- scripts/generate-releases.sh | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 9aef4a8a..9c9f7d8d 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ See [konflux docs](https://github.com/konflux-ci/build-definitions/blob/c93ea73d 1. make sure the previous operator index release is complete (has a green check mark emoticon) 2. if not, coordinate with the person conducting that release 3. once that release is complete, start a new thread for your release -6. Apply generated CRs to the cluster: `oc create -f release-history/--.yaml` +6. Apply generated CRs to the cluster: `oc create -f release-history/--.yaml` 7. Monitor release [using monitor release script](#monitoring-release). Each supported OCP version has its own `Release`. Successfully finished `Release` has `Succeeded` status. 8. Follow [the restarting release step below](#restarting-konflux-release) if any of the `Release`s fails for any OCP version. 9. (Skip for `stage` release.) Once done, go back to the Slack thread you started earlier, add a message that your release is done and add a green check mark emoticon on the initial message of the thread. diff --git a/scripts/generate-releases.sh b/scripts/generate-releases.sh index fa2e9dc4..0d2242a6 100755 --- a/scripts/generate-releases.sh +++ b/scripts/generate-releases.sh @@ -94,19 +94,6 @@ validate_snapshots() { fi } -# Validate the length of the release name. -# To allow for Konflux' re-run suffix (12 chars), the full release name must be at most 51 characters long. -# Otherwise, the re-run Release CR will fail to be created as its name would exceed the Kubernetes limit of 63 characters. -validate_release_name_length() { - local -r release_name_with_application="$1" - - if [[ ${#release_name_with_application} -gt 51 ]]; then - echo "ERROR: Generated release name '${release_name_with_application}' is ${#release_name_with_application} characters long, which exceeds the 51 character limit." >&2 - echo "You must update the script to generate a shorter release name." >&2 - exit 1 - fi -} - # Generate the Release resources for each snapshot found. generate_release_resources() { local -r environment="$1" @@ -126,7 +113,7 @@ generate_release_resources() { while IFS= read -r line do snapshot="$(echo "$line" | cut -d "|" -f 1)" - snapshot_copy_name="$(echo "${snapshot%-*}-${release_name_suffix}" | cut -c -51)" # replace random suffix with release name and crop to 63 characters to avoid the Kubernetes limit. + snapshot_copy_name="$(echo "${snapshot%-*}-${release_name_suffix}" | cut -c -63)" # Replace random suffix with release name and crop to 63 characters to avoid running over the Kubernetes limit. echo "---" kubectl -n rh-acs-tenant get snapshot.appstudio.redhat.com "${snapshot}" -o yaml | \ "${YQ}" -P 'load("'"${whitelist_file}"'") as $whitelisted @@ -145,7 +132,7 @@ generate_release_resources() { application="$(echo "$line" | cut -d "|" -f 2)" - # Crop the release name to 51 characters to avoid the Kubernetes limit of 63 characters for re-runs. + # Crop the release name to 51 characters to avoid exceeding the Kubernetes limit of 63 characters for re-runs. release_name_with_application="$(echo "${application}-${release_name_suffix}" | cut -c -51)" release_plan="${application/acs-operator-index/acs-operator-index-${environment}}"