From dfb30e6cf113e5868962730f1294da6b115aa9e7 Mon Sep 17 00:00:00 2001 From: Kellen Sappington Date: Mon, 30 Sep 2024 20:49:20 +0000 Subject: [PATCH] Only render ServiceMonitor annotations if not empty --- charts/cluster-autoscaler/Chart.yaml | 2 +- charts/cluster-autoscaler/templates/servicemonitor.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index fbe7fa807601..6e8e5de0e295 100644 --- a/charts/cluster-autoscaler/Chart.yaml +++ b/charts/cluster-autoscaler/Chart.yaml @@ -11,4 +11,4 @@ name: cluster-autoscaler sources: - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler type: application -version: 9.42.0 +version: 9.43.0 diff --git a/charts/cluster-autoscaler/templates/servicemonitor.yaml b/charts/cluster-autoscaler/templates/servicemonitor.yaml index 99da7fbd5f5e..9ce83a2ef6e1 100644 --- a/charts/cluster-autoscaler/templates/servicemonitor.yaml +++ b/charts/cluster-autoscaler/templates/servicemonitor.yaml @@ -6,8 +6,10 @@ metadata: {{- if .Values.serviceMonitor.namespace }} namespace: {{ .Values.serviceMonitor.namespace }} {{- end }} + {{- if .Values.serviceMonitor.annotations }} annotations: {{ toYaml .Values.serviceMonitor.annotations | indent 4 }} + {{- end }} labels: {{- range $key, $value := .Values.serviceMonitor.selector }} {{ $key }}: {{ $value | quote }}