Skip to content

Commit

Permalink
Add labels from global.commonLabels and prometheus.serviceMonitor.lab…
Browse files Browse the repository at this point in the history
…els if defined

Signed-off-by: lou-lan <[email protected]>
  • Loading branch information
lou-lan committed Nov 28, 2024
1 parent f9b202f commit f42a0ff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions charts/spiderpool/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ metadata:
name: {{ .Values.spiderpoolAgent.name | trunc 63 | trimSuffix "-" }}
namespace: {{ default .Release.Namespace .Values.spiderpoolAgent.prometheus.serviceMonitor.namespace }}
labels:
{{- if .Values.global.commonLabels }}
{{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.spiderpoolAgent.prometheus.serviceMonitor.labels }}
{{- include "tplvalues.render" ( dict "value" .Values.grafanaDashboard.labels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.global.commonAnnotations .Values.spiderpoolAgent.prometheus.serviceMonitor.annotations }}
annotations:
{{- if .Values.global.commonAnnotations }}
Expand Down Expand Up @@ -36,6 +42,13 @@ kind: ServiceMonitor
metadata:
name: {{ .Values.spiderpoolController.name | trunc 63 | trimSuffix "-" }}
namespace: {{ default .Release.Namespace .Values.spiderpoolController.prometheus.serviceMonitor.namespace }}
labels:
{{- if .Values.global.commonLabels }}
{{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.spiderpoolController.prometheus.serviceMonitor.labels }}
{{- include "tplvalues.render" ( dict "value" .Values.grafanaDashboard.labels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.global.commonAnnotations .Values.spiderpoolController.prometheus.serviceMonitor.annotations }}
annotations:
{{- if .Values.global.commonAnnotations }}
Expand Down

0 comments on commit f42a0ff

Please sign in to comment.