Don't render extraLabels in ServiceMonitor if they are not given

This produced invalid YAML before.
This commit is contained in:
Alfred Krohmer 2019-09-03 16:45:35 +02:00 committed by Artem Navoiev
parent 3182e2a66b
commit 7cde25bac4
3 changed files with 6 additions and 0 deletions

View File

@ -8,7 +8,9 @@ metadata:
{{- end }}
labels:
{{- include "victoria-metrics.vminsert.labels" . | nindent 4 }}
{{- if .Values.vminsert.serviceMonitor.extraLabels }}
{{ toYaml .Values.vminsert.serviceMonitor.extraLabels | indent 4 }}
{{- end }}
name: {{ template "victoria-metrics.vminsert.fullname" . }}
spec:
namespaceSelector:

View File

@ -8,7 +8,9 @@ metadata:
{{- end }}
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 4 }}
{{- if .Values.vmselect.serviceMonitor.extraLabels }}
{{ toYaml .Values.vmselect.serviceMonitor.extraLabels | indent 4 }}
{{- end }}
name: {{ template "victoria-metrics.vmselect.fullname" . }}
spec:
namespaceSelector:

View File

@ -8,7 +8,9 @@ metadata:
{{- end }}
labels:
{{- include "victoria-metrics.vmstorage.labels" . | nindent 4 }}
{{- if .Values.vmstorage.serviceMonitor.extraLabels }}
{{ toYaml .Values.vmstorage.serviceMonitor.extraLabels | indent 4 }}
{{- end }}
name: {{ template "victoria-metrics.vmstorage.fullname" . }}
spec:
namespaceSelector: