Using helper for secret name in multiple places

This commit is contained in:
Andy Feller 2020-07-01 22:20:16 -04:00
parent 6a001fe940
commit 1818256cda
3 changed files with 9 additions and 2 deletions

View file

@ -92,3 +92,10 @@ Create the name of the bot service account to use
{{ default "default" .Values.bots.slack.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the secret to use
*/}}
{{- define "argocd-notifications.secretName" -}}
{{- printf "%s-secret" (include "argocd-notifications.name" .) -}}
{{- end -}}

View file

@ -18,7 +18,7 @@ rules:
- apiGroups:
- ""
resourceNames:
- argocd-notifications-secret
- {{ include "argocd-notifications.secretName" . }}
resources:
- secrets
verbs:

View file

@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "argocd-notifications.name" . }}-secret
name: {{ include "argocd-notifications.secretName" . }}
labels:
{{- include "argocd-notifications.labels" . | nindent 4 }}
type: Opaque