From aee22517dbefe201df4ef48fd7b51e6a6feba302 Mon Sep 17 00:00:00 2001 From: Michael Burman Date: Mon, 8 Jan 2024 16:25:25 +0200 Subject: [PATCH] Add helm.sh/resource-policy=keep to the CRDs in the chart, update to cass-config-builder-ubi8 --- config/manager/image_config.yaml | 2 +- scripts/release-helm-chart.sh | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/config/manager/image_config.yaml b/config/manager/image_config.yaml index ff48d520..522ba582 100644 --- a/config/manager/image_config.yaml +++ b/config/manager/image_config.yaml @@ -4,7 +4,7 @@ metadata: name: image-config images: system-logger: "k8ssandra/system-logger:latest" - config-builder: "datastax/cass-config-builder:1.0-ubi7" + config-builder: "datastax/cass-config-builder:1.0-ubi8" k8ssandra-client: "k8ssandra/k8ssandra-client:v0.2.2" # cassandra: # "4.0.0": "k8ssandra/cassandra-ubi:latest" diff --git a/scripts/release-helm-chart.sh b/scripts/release-helm-chart.sh index 326274f6..c16cb2f7 100755 --- a/scripts/release-helm-chart.sh +++ b/scripts/release-helm-chart.sh @@ -13,6 +13,9 @@ if [ "$#" -ne 1 ]; then exit fi +# Includes here to get all the updates even if we swap to an older branch +. scripts/lib.sh + # This should work with BSD/MacOS mktemp and GNU one CRD_TMP_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'crd') @@ -36,12 +39,13 @@ done # Add Helm conditionals to the end and beginning of CRDs before applying them to the templates path echo "Updating CRDs in" $TEMPLATE_HOME CRD_FILE_NAME=$TEMPLATE_HOME/crds.yaml -echo '{{- if .Values.updateCRDs }}' > $CRD_FILE_NAME +echo '{{- if .Values.manageCrds }}' > $CRD_FILE_NAME declare -a files files=($CRD_TARGET_PATH/*) for i in ${!files[@]}; do echo "Processing " ${files[$i]} + yq -i '.metadata.annotations."helm.sh/resource-policy" = "keep"' ${files[$i]} cat ${files[$i]} >> $CRD_FILE_NAME if [[ $i -lt ${#files[@]}-1 ]]; then echo "---" >> $CRD_FILE_NAME @@ -53,7 +57,6 @@ rm -fr $CRD_TMP_DIR # Update version of the Chart.yaml automatically (to next minor one) CURRENT_VERSION=$(yq '.version' $CHART_HOME/Chart.yaml) -. scripts/lib.sh next_minor_version echo "Updating Chart.yaml version to next minor version" $NEXT_VERSION yq -i '.version = "'"$NEXT_VERSION"'"' $CHART_HOME/Chart.yaml @@ -68,6 +71,6 @@ SYSTEM_LOGGER_IMAGE=$(yq '.images.system-logger' config/manager/image_config.yam K8SSANDRA_CLIENT_IMAGE=$(yq '.images.k8ssandra-client' config/manager/image_config.yaml) CONFIG_BUILDER_IMAGE=$(yq '.images.config-builder' config/manager/image_config.yaml) -yq -i '.imageConfig.systemLogger = "cr.k8ssandra.io" + "/" + "'"$SYSTEM_LOGGER_IMAGE"'"' $CHART_HOME/values.yaml -yq -i '.imageConfig.k8ssandraClient = "cr.k8ssandra.io" + "/" + "'"$K8SSANDRA_CLIENT_IMAGE"'"' $CHART_HOME/values.yaml -yq -i '.imageConfig.configBuilder = "cr.dtsx.io" + "/" + "'"$CONFIG_BUILDER_IMAGE"'"' $CHART_HOME/values.yaml \ No newline at end of file +yq -i '.imageConfig.systemLogger = "'"$SYSTEM_LOGGER_IMAGE"'"' $CHART_HOME/values.yaml +yq -i '.imageConfig.k8ssandraClient = "'"$K8SSANDRA_CLIENT_IMAGE"'"' $CHART_HOME/values.yaml +yq -i '.imageConfig.configBuilder = "'"$CONFIG_BUILDER_IMAGE"'"' $CHART_HOME/values.yaml \ No newline at end of file