From e89a7d78780299fdfd7501bc957b6e72c4b0f714 Mon Sep 17 00:00:00 2001 From: Artyom Babiy Date: Mon, 9 Jun 2025 23:12:41 +0300 Subject: [PATCH] helm(rook-ceph-cluster): use nested if clauses in prometheusrule template This change returns the use of nested if clauses instead of `and` function shortcut to avoid errors in older helm versions. Signed-off-by: Artyom Babiy (cherry picked from commit 1f183bd6750899a41fcfe5a4f80487fad5de42f9) --- .../rook-ceph-cluster/templates/prometheusrules.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deploy/charts/rook-ceph-cluster/templates/prometheusrules.yaml b/deploy/charts/rook-ceph-cluster/templates/prometheusrules.yaml index 2ebb1acd0..7400e35bb 100644 --- a/deploy/charts/rook-ceph-cluster/templates/prometheusrules.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/prometheusrules.yaml @@ -1,4 +1,5 @@ -{{- if and .Values.monitoring .Values.monitoring.createPrometheusRules }} +{{- if .Values.monitoring }} +{{- if .Values.monitoring.createPrometheusRules }} --- apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule @@ -17,8 +18,10 @@ metadata: namespace: {{ default .Release.Namespace .Values.monitoring.rulesNamespaceOverride }} spec: {{- $rulesFile := "prometheus/localrules.yaml" }} - {{- if and .Values.cephClusterSpec.external .Values.cephClusterSpec.external.enable }} - {{- $rulesFile = "prometheus/externalrules.yaml" }} + {{- if .Values.cephClusterSpec.external }} + {{- if .Values.cephClusterSpec.external.enable }} + {{- $rulesFile = "prometheus/externalrules.yaml" }} + {{- end }} {{- end }} {{- $defaultRules := .Files.Get $rulesFile | fromYaml }} groups: @@ -43,3 +46,4 @@ spec: {{- end }} {{- end }} {{- end }} +{{- end }}