From 2fbf152e36115ac72fab81f9d2acc6225627e9cf Mon Sep 17 00:00:00 2001 From: Himanshu Bohra <113414131+hibohra1398@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:25:57 +0530 Subject: [PATCH 1/2] Update servicemonitor.yaml --- helm/templates/servicemonitor.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/templates/servicemonitor.yaml b/helm/templates/servicemonitor.yaml index 2c82cb4..ce5409f 100644 --- a/helm/templates/servicemonitor.yaml +++ b/helm/templates/servicemonitor.yaml @@ -1,4 +1,4 @@ -{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) ( .Values.servicemonitor.enabled ) ( .Values.prometheus.jmx.enabled ) }} +{{- if and ( .Values.servicemonitor.enabled ) ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) ( .Values.prometheus.jmx.enabled ) }} --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor From 1bf5ba84bd8c5f07b9ffa9b1c113a33ed0d051e7 Mon Sep 17 00:00:00 2001 From: Himanshu Bohra <113414131+hibohra1398@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:33:10 +0530 Subject: [PATCH 2/2] Update servicemonitor.yaml --- helm/templates/servicemonitor.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helm/templates/servicemonitor.yaml b/helm/templates/servicemonitor.yaml index ce5409f..d20ecc9 100644 --- a/helm/templates/servicemonitor.yaml +++ b/helm/templates/servicemonitor.yaml @@ -1,4 +1,5 @@ -{{- if and ( .Values.servicemonitor.enabled ) ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) ( .Values.prometheus.jmx.enabled ) }} +{{- if .Values.servicemonitor.enabled }} +{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) ( .Values.prometheus.jmx.enabled ) }} --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -33,3 +34,4 @@ spec: matchNames: - {{ .Release.Namespace }} {{- end }} +{{- end }}