chore(argo-cd): Metrics DRY cleaning (#1569)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>
This commit is contained in:
Petr Drastil 2022-10-25 16:08:51 +02:00 committed by GitHub
parent e217e71580
commit 24de82b214
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 48 deletions

View file

@ -2,18 +2,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "argo-cd.notifications.fullname" . }}-metrics
name: {{ include "argo-cd.notifications.fullname" . }}-metrics
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" "metrics") | nindent 4 }}
{{- if .Values.notifications.metrics.service.labels }}
{{- toYaml .Values.notifications.metrics.service.labels | nindent 4 }}
{{- end }}
{{- if .Values.notifications.metrics.service.annotations }}
{{- with .Values.notifications.metrics.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.notifications.metrics.service.annotations }}
annotations:
{{- range $key, $value := .Values.notifications.metrics.service.annotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.notifications.name) | nindent 6 }}