feat(argocd-notifications): Support new notification controller features from argoproj-labs/argocd-notifications#77 (#1066)

* Support setting secret name

Signed-off-by: Hendrik Maus <aidentailor@gmail.com>

* Support setting configmap name

Signed-off-by: Hendrik Maus <aidentailor@gmail.com>

* Use the fullname template for secret name

Signed-off-by: Hendrik Maus <aidentailor@gmail.com>

* Use the fullname template for configmap name

Signed-off-by: Hendrik Maus <aidentailor@gmail.com>

* Bump chart version 1.6.1 -> 1.7.0

Signed-off-by: Hendrik Maus <aidentailor@gmail.com>

* Update changelog

Signed-off-by: Hendrik Maus <aidentailor@gmail.com>

* Update README

Signed-off-by: Hendrik Maus <aidentailor@gmail.com>

Co-authored-by: Marko Bevc <marko@scalefactory.com>
This commit is contained in:
Hendrik Maus 2021-12-20 19:17:54 +01:00 committed by GitHub
parent dbcd02fd8d
commit 0ce72e3028
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 4 deletions

View file

@ -3,7 +3,7 @@ appVersion: v1.2.1
description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD. description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD.
name: argocd-notifications name: argocd-notifications
type: application type: application
version: 1.6.1 version: 1.7.0
home: https://github.com/argoproj/argo-helm home: https://github.com/argoproj/argo-helm
icon: https://argocd-notifications.readthedocs.io/en/stable/assets/logo.png icon: https://argocd-notifications.readthedocs.io/en/stable/assets/logo.png
keywords: keywords:
@ -15,4 +15,4 @@ maintainers:
- name: andyfeller - name: andyfeller
annotations: annotations:
artifacthub.io/changes: | artifacthub.io/changes: |
- "[Changed]: Update to app version v1.2.1" - "[Added]: Support for dynamic Secret and ConfigMap names"

View file

@ -23,6 +23,7 @@ docker run --rm --volume "$(pwd):/helm-docs" -u $(id -u) jnorwood/helm-docs:late
| affinity | object | `{}` | Assign custom [affinity] rules | | affinity | object | `{}` | Assign custom [affinity] rules |
| argocdUrl | string | `nil` | ArgoCD dashboard url; used in place of {{.context.argocdUrl}} in templates | | argocdUrl | string | `nil` | ArgoCD dashboard url; used in place of {{.context.argocdUrl}} in templates |
| cm.create | bool | `true` | Whether helm chart creates controller config map | | cm.create | bool | `true` | Whether helm chart creates controller config map |
| cm.name | string | `""` | The name of the config map to use. |
| containerSecurityContext | object | `{}` | Container Security Context | | containerSecurityContext | object | `{}` | Container Security Context |
| context | object | `{}` | Define user-defined context | | context | object | `{}` | Define user-defined context |
| extraArgs | list | `[]` | Extra arguments to provide to the controller | | extraArgs | list | `[]` | Extra arguments to provide to the controller |
@ -48,6 +49,7 @@ docker run --rm --volume "$(pwd):/helm-docs" -u $(id -u) jnorwood/helm-docs:late
| secret.annotations | object | `{}` | key:value pairs of annotations to be added to the secret | | secret.annotations | object | `{}` | key:value pairs of annotations to be added to the secret |
| secret.create | bool | `true` | Whether helm chart creates controller secret | | secret.create | bool | `true` | Whether helm chart creates controller secret |
| secret.items | object | `{}` | Generic key:value pairs to be inserted into the secret | | secret.items | object | `{}` | Generic key:value pairs to be inserted into the secret |
| secret.name | string | `""` | The name of the secret to use. |
| securityContext | object | `{"runAsNonRoot":true}` | Pod Security Context | | securityContext | object | `{"runAsNonRoot":true}` | Pod Security Context |
| serviceAccount.annotations | object | `{}` | Annotations applied to created service account | | serviceAccount.annotations | object | `{}` | Annotations applied to created service account |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | | serviceAccount.create | bool | `true` | Specifies whether a service account should be created |

View file

@ -113,3 +113,26 @@ Create the name of the bot service account to use
{{ default "default" .Values.bots.slack.serviceAccount.name }} {{ default "default" .Values.bots.slack.serviceAccount.name }}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{/*
Create the name of the secret to use
*/}}
{{- define "argocd-notifications.secretName" -}}
{{- if .Values.secret.create -}}
{{ default (printf "%s-secret" (include "argocd-notifications.fullname" .)) .Values.secret.name }}
{{- else -}}
{{ default "argocd-notifications-secret" .Values.secret.name }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the configmap to use
*/}}
{{- define "argocd-notifications.configMapName" -}}
{{- if .Values.cm.create -}}
{{ default (printf "%s-cm" (include "argocd-notifications.fullname" .)) .Values.cm.name }}
{{- else -}}
{{ default "argocd-notifications-cm" .Values.cm.name }}
{{- end -}}
{{- end -}}

View file

@ -2,7 +2,7 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: argocd-notifications-cm name: {{ include "argocd-notifications.configMapName" . }}
labels: labels:
{{- include "argocd-notifications.labels" . | nindent 4 }} {{- include "argocd-notifications.labels" . | nindent 4 }}
data: data:

View file

@ -45,6 +45,8 @@ spec:
{{- if .Values.metrics.enabled }} {{- if .Values.metrics.enabled }}
- --metrics-port={{ .Values.metrics.port }} - --metrics-port={{ .Values.metrics.port }}
{{- end }} {{- end }}
- --secret-name={{ include "argocd-notifications.secretName" . }}
- --config-map-name={{ include "argocd-notifications.configMapName" . }}
{{- range .Values.extraArgs }} {{- range .Values.extraArgs }}
- {{ . | squote }} - {{ . | squote }}
{{- end }} {{- end }}

View file

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

View file

@ -41,6 +41,10 @@ secret:
# -- key:value pairs of annotations to be added to the secret # -- key:value pairs of annotations to be added to the secret
annotations: {} annotations: {}
# -- The name of the secret to use.
## If not set and create is true, the default name 'argocd-notifications-secret' is used
name: ""
# -- Generic key:value pairs to be inserted into the secret # -- Generic key:value pairs to be inserted into the secret
## Can be used for templates, notification services etc. Some examples given below. ## Can be used for templates, notification services etc. Some examples given below.
## For more information: https://argocd-notifications.readthedocs.io/en/stable/services/overview/ ## For more information: https://argocd-notifications.readthedocs.io/en/stable/services/overview/
@ -129,6 +133,10 @@ cm:
# -- Whether helm chart creates controller config map # -- Whether helm chart creates controller config map
create: true create: true
# -- The name of the config map to use.
## If not set and create is true, the default name 'argocd-notifications-cm' is used
name: ""
# -- Contains centrally managed global application subscriptions # -- Contains centrally managed global application subscriptions
## For more information: https://argocd-notifications.readthedocs.io/en/stable/subscriptions/ ## For more information: https://argocd-notifications.readthedocs.io/en/stable/subscriptions/
subscriptions: {} subscriptions: {}