From 5ed9b8bdb6312ae58c9ae926bce764086067f054 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Thu, 19 Dec 2024 03:36:10 +0000 Subject: [PATCH] Ensure helm release build consistently handles deployOLM toggle. Fix bug caused by separating out csv-deleter Job Signed-off-by: Dom Del Nano --- ci/operator_helm_build_release.sh | 2 +- k8s/operator/helm/templates/00_olm.yaml | 2 +- k8s/operator/helm/templates/csv-deleter.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/operator_helm_build_release.sh b/ci/operator_helm_build_release.sh index b1b68ceb84b..3c5d415be21 100755 --- a/ci/operator_helm_build_release.sh +++ b/ci/operator_helm_build_release.sh @@ -57,7 +57,7 @@ cp "${repo_path}/k8s/operator/crd/base/px.dev_viziers.yaml" "${helm_path}/crds/v # Updates templates with Helm-specific template functions. helm_tmpl_checks="$(cat "${repo_path}/k8s/operator/helm/olm_template_checks.tmpl")" -sed -i "1c${helm_tmpl_checks}" "${repo_path}/k8s/operator/helm/templates/00_olm.yaml" +find "${repo_path}/k8s/operator/helm/templates" -type f -exec sed -i "/HELM_DEPLOY_OLM_PLACEHOLDER/c\\${helm_tmpl_checks}" {} \; rm "${repo_path}/k8s/operator/helm/olm_template_checks.tmpl" # Fetch all of the current charts in GCS, because generating the index needs all pre-existing tar versions present. diff --git a/k8s/operator/helm/templates/00_olm.yaml b/k8s/operator/helm/templates/00_olm.yaml index 186c9ace866..381c8569daa 100644 --- a/k8s/operator/helm/templates/00_olm.yaml +++ b/k8s/operator/helm/templates/00_olm.yaml @@ -1,4 +1,4 @@ -{{if .Values.deployOLM}} +{{if .Values.deployOLM}}{{- /* HELM_DEPLOY_OLM_PLACEHOLDER */ -}} {{ if not (eq .Values.olmNamespace .Release.Namespace) }} --- apiVersion: v1 diff --git a/k8s/operator/helm/templates/csv-deleter.yaml b/k8s/operator/helm/templates/csv-deleter.yaml index c13669e7ca5..f785a63e79f 100644 --- a/k8s/operator/helm/templates/csv-deleter.yaml +++ b/k8s/operator/helm/templates/csv-deleter.yaml @@ -1,4 +1,4 @@ -{{if .Values.deployOLM}} +{{if .Values.deployOLM}}{{- /* HELM_DEPLOY_OLM_PLACEHOLDER */ -}} --- apiVersion: batch/v1 kind: Job