Skip to content

Commit

Permalink
Merge pull request spidernet-io#4341 from spidernet-io/chart/label
Browse files Browse the repository at this point in the history
Add labels to ServiceMonitor if defined
  • Loading branch information
lou-lan authored Nov 29, 2024
2 parents 832971e + f42a0ff commit e3b8408
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 e3b8408

Please sign in to comment.