diff --git a/charts/argocd-notifications/Chart.yaml b/charts/argocd-notifications/Chart.yaml index 43fc4848..1696630c 100644 --- a/charts/argocd-notifications/Chart.yaml +++ b/charts/argocd-notifications/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 0.7.0 description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD. name: argocd-notifications type: application -version: 1.0.5 +version: 1.0.6 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argocd-notifications/templates/_helpers.tpl b/charts/argocd-notifications/templates/_helpers.tpl index 7540cf20..18235d26 100644 --- a/charts/argocd-notifications/templates/_helpers.tpl +++ b/charts/argocd-notifications/templates/_helpers.tpl @@ -87,7 +87,7 @@ Create the name of the bot service account to use */}} {{- define "argocd-notifications.bots.slack.serviceAccountName" -}} {{- if .Values.bots.slack.serviceAccount.create -}} - {{ default (include "argocd-notifications.fullname" .) .Values.bots.slack.serviceAccount.name }} + {{ default (printf "%s-bot" (include "argocd-notifications.fullname" .)) .Values.bots.slack.serviceAccount.name }} {{- else -}} {{ default "default" .Values.bots.slack.serviceAccount.name }} {{- end -}} diff --git a/charts/argocd-notifications/templates/bots/slack/deployment.yaml b/charts/argocd-notifications/templates/bots/slack/deployment.yaml index c53efb74..284d3c10 100644 --- a/charts/argocd-notifications/templates/bots/slack/deployment.yaml +++ b/charts/argocd-notifications/templates/bots/slack/deployment.yaml @@ -20,7 +20,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "argocd-notifications.serviceAccountName" . }}-bot + serviceAccountName: {{ include "argocd-notifications.bots.slack.serviceAccountName" . }} containers: - name: {{ include "argocd-notifications.name" . }}-bot image: "{{ .Values.bots.slack.image.repository }}:{{ .Values.bots.slack.image.tag }}" diff --git a/charts/argocd-notifications/templates/bots/slack/role.yaml b/charts/argocd-notifications/templates/bots/slack/role.yaml index 5127fcac..b509f6d4 100644 --- a/charts/argocd-notifications/templates/bots/slack/role.yaml +++ b/charts/argocd-notifications/templates/bots/slack/role.yaml @@ -15,4 +15,13 @@ rules: - watch - update - patch +- apiGroups: + - "" + resources: + - secrets + - configmaps + verbs: + - get + - list + - watch {{ end }} diff --git a/charts/argocd-notifications/templates/bots/slack/serviceaccount.yaml b/charts/argocd-notifications/templates/bots/slack/serviceaccount.yaml index ce28ad58..badee60f 100644 --- a/charts/argocd-notifications/templates/bots/slack/serviceaccount.yaml +++ b/charts/argocd-notifications/templates/bots/slack/serviceaccount.yaml @@ -1,4 +1,4 @@ -{{ if and .Values.bots.slack.enabled .Values.secret.create }} +{{- if .Values.bots.slack.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/argocd-notifications/templates/serviceaccount.yaml b/charts/argocd-notifications/templates/serviceaccount.yaml index 5181c5a4..591d13bd 100644 --- a/charts/argocd-notifications/templates/serviceaccount.yaml +++ b/charts/argocd-notifications/templates/serviceaccount.yaml @@ -1,6 +1,8 @@ +{{- if .Values.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "argocd-notifications.serviceAccountName" . }} labels: {{- include "argocd-notifications.labels" . | nindent 4 }} +{{- end }}