From 8f69e55a31825dc769efd16c727ecbf9977d755d Mon Sep 17 00:00:00 2001 From: sergeyshaykhullin Date: Mon, 22 Jun 2020 16:53:24 +0300 Subject: [PATCH] Add slack.enabled flag --- .../argocd-notifications/templates/slack-bot/deployment.yaml | 2 ++ charts/argocd-notifications/templates/slack-bot/role.yaml | 2 ++ .../argocd-notifications/templates/slack-bot/rolebinding.yaml | 2 ++ charts/argocd-notifications/templates/slack-bot/service.yaml | 2 ++ .../templates/slack-bot/serviceaccount.yaml | 2 +- charts/argocd-notifications/values.yaml | 3 +++ 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/charts/argocd-notifications/templates/slack-bot/deployment.yaml b/charts/argocd-notifications/templates/slack-bot/deployment.yaml index 75b651ca..c53efb74 100644 --- a/charts/argocd-notifications/templates/slack-bot/deployment.yaml +++ b/charts/argocd-notifications/templates/slack-bot/deployment.yaml @@ -1,3 +1,4 @@ +{{ if .Values.bots.slack.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -41,3 +42,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} +{{ end }} diff --git a/charts/argocd-notifications/templates/slack-bot/role.yaml b/charts/argocd-notifications/templates/slack-bot/role.yaml index 3802336d..5127fcac 100644 --- a/charts/argocd-notifications/templates/slack-bot/role.yaml +++ b/charts/argocd-notifications/templates/slack-bot/role.yaml @@ -1,3 +1,4 @@ +{{ if .Values.bots.slack.enabled }} apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: @@ -14,3 +15,4 @@ rules: - watch - update - patch +{{ end }} diff --git a/charts/argocd-notifications/templates/slack-bot/rolebinding.yaml b/charts/argocd-notifications/templates/slack-bot/rolebinding.yaml index df6d6193..6a87bb49 100644 --- a/charts/argocd-notifications/templates/slack-bot/rolebinding.yaml +++ b/charts/argocd-notifications/templates/slack-bot/rolebinding.yaml @@ -1,3 +1,4 @@ +{{ if .Values.bots.slack.enabled }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -9,3 +10,4 @@ roleRef: subjects: - kind: ServiceAccount name: {{ include "argocd-notifications.bots.slack.serviceAccountName" . }} +{{ end }} diff --git a/charts/argocd-notifications/templates/slack-bot/service.yaml b/charts/argocd-notifications/templates/slack-bot/service.yaml index d56e11b9..1878fe9d 100644 --- a/charts/argocd-notifications/templates/slack-bot/service.yaml +++ b/charts/argocd-notifications/templates/slack-bot/service.yaml @@ -1,3 +1,4 @@ +{{ if .Values.bots.slack.enabled }} apiVersion: v1 kind: Service metadata: @@ -11,3 +12,4 @@ spec: selector: {{- include "argocd-notifications.bots.slack.selectorLabels" . | nindent 4 }} type: {{ .Values.bots.slack.service.type }} +{{ end }} diff --git a/charts/argocd-notifications/templates/slack-bot/serviceaccount.yaml b/charts/argocd-notifications/templates/slack-bot/serviceaccount.yaml index 1bbb530e..ce28ad58 100644 --- a/charts/argocd-notifications/templates/slack-bot/serviceaccount.yaml +++ b/charts/argocd-notifications/templates/slack-bot/serviceaccount.yaml @@ -1,4 +1,4 @@ -{{ if .Values.secret.create }} +{{ if and .Values.bots.slack.enabled .Values.secret.create }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/argocd-notifications/values.yaml b/charts/argocd-notifications/values.yaml index 65eab64e..d7769bf7 100644 --- a/charts/argocd-notifications/values.yaml +++ b/charts/argocd-notifications/values.yaml @@ -162,6 +162,9 @@ triggers: bots: # For more information: https://argoproj-labs.github.io/argocd-notifications/recipients/bot/ slack: + # You have to set secret.notifiers.slack.signingSecret + enabled: false + updateStrategy: type: Recreate