Cleanup config files to keep them DRY (#1470)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>
pull/1472/head argo-cd-5.4.8
Petr Drastil 2022-09-21 09:32:06 +02:00 committed by GitHub
parent 8847af4522
commit 8ee317128d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 62 additions and 55 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v2.4.12
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
version: 5.4.7
version: 5.4.8
home: https://github.com/argoproj/argo-helm
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
keywords:
@ -19,4 +19,4 @@ dependencies:
condition: redis-ha.enabled
annotations:
artifacthub.io/changes: |
- "[Added]: Add privateKey spec handling from CertificatePrivateKey"
- "[Changed]: Cleanup of config files to keep them DRY"

View File

@ -5,11 +5,12 @@ metadata:
name: argocd-cm
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "cm") | nindent 4 }}
{{- if .Values.server.configAnnotations }}
{{- with .Values.server.configAnnotations }}
annotations:
{{- range $key, $value := .Values.server.configAnnotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
data: {{- include "argo-cd.config" $ | nindent 4 }}
{{- end }}
data:
{{- include "argo-cd.config" $ | nindent 2 }}
{{- end }}

View File

@ -1,15 +1,15 @@
apiVersion: v1
kind: ConfigMap
metadata:
{{- if .Values.configs.gpgKeysAnnotations }}
name: argocd-gpg-keys-cm
labels:
{{- include "argo-cd.labels" (dict "context" . "name" "gpg-keys-cm") | nindent 4 }}
{{- with .Values.configs.gpgKeysAnnotations }}
annotations:
{{- range $key, $value := .Values.configs.gpgKeysAnnotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "argo-cd.labels" (dict "context" . "name" "gpg-keys-cm") | nindent 4 }}
name: argocd-gpg-keys-cm
{{- with .Values.configs.gpgKeys }}
data:
{{- toYaml . | nindent 2 }}

View File

@ -8,9 +8,9 @@ metadata:
data:
context: |
argocdUrl: {{ .Values.notifications.argocdUrl | quote }}
{{- with .Values.notifications.context }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.notifications.context }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.notifications.notifiers }}
{{- toYaml . | nindent 2 }}
{{- end }}

View File

@ -5,11 +5,11 @@ metadata:
name: argocd-notifications-secret
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
{{- if .Values.notifications.secret.annotations }}
{{- with .Values.notifications.secret.annotations }}
annotations:
{{- range $key, $value := .Values.notifications.secret.annotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
type: Opaque
stringData:

View File

@ -5,14 +5,14 @@ metadata:
name: argocd-rbac-cm
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "rbac-cm") | nindent 4 }}
{{- if .Values.server.rbacConfigAnnotations }}
{{- with .Values.server.rbacConfigAnnotations }}
annotations:
{{- range $key, $value := .Values.server.rbacConfigAnnotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.server.rbacConfig }}
{{- with .Values.server.rbacConfig }}
data:
{{- toYaml .Values.server.rbacConfig | nindent 4 }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}

View File

@ -5,34 +5,34 @@ metadata:
name: argocd-secret
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "secret") | nindent 4 }}
{{- if .Values.configs.secret.annotations }}
{{- with .Values.configs.secret.annotations }}
annotations:
{{- range $key, $value := .Values.configs.secret.annotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
type: Opaque
{{- if or .Values.configs.secret.githubSecret (or .Values.configs.secret.gitlabSecret .Values.configs.secret.bitbucketUUID .Values.configs.secret.bitbucketServerSecret .Values.configs.secret.gogsSecret .Values.configs.secret.argocdServerAdminPassword .Values.configs.secret.argocdServerTlsConfig .Values.configs.secret.extra) }}
# Setting a blank data again will wipe admin password/key/cert
data:
{{- if .Values.configs.secret.githubSecret }}
webhook.github.secret: {{ .Values.configs.secret.githubSecret | b64enc }}
{{- with .Values.configs.secret.githubSecret }}
webhook.github.secret: {{ . | b64enc }}
{{- end }}
{{- if .Values.configs.secret.gitlabSecret }}
webhook.gitlab.secret: {{ .Values.configs.secret.gitlabSecret | b64enc }}
{{- with .Values.configs.secret.gitlabSecret }}
webhook.gitlab.secret: {{ . | b64enc }}
{{- end }}
{{- if .Values.configs.secret.bitbucketServerSecret }}
webhook.bitbucketserver.secret: {{ .Values.configs.secret.bitbucketServerSecret | b64enc }}
{{- with .Values.configs.secret.bitbucketServerSecret }}
webhook.bitbucketserver.secret: {{ . | b64enc }}
{{- end }}
{{- if .Values.configs.secret.bitbucketUUID }}
webhook.bitbucket.uuid: {{ .Values.configs.secret.bitbucketUUID | b64enc }}
{{- with .Values.configs.secret.bitbucketUUID }}
webhook.bitbucket.uuid: {{ . | b64enc }}
{{- end }}
{{- if .Values.configs.secret.gogsSecret }}
webhook.gogs.secret: {{ .Values.configs.secret.gogsSecret | b64enc }}
{{- with .Values.configs.secret.gogsSecret }}
webhook.gogs.secret: {{ . | b64enc }}
{{- end }}
{{- if .Values.configs.secret.argocdServerTlsConfig }}
tls.key: {{ .Values.configs.secret.argocdServerTlsConfig.key | b64enc }}
tls.crt: {{ .Values.configs.secret.argocdServerTlsConfig.crt | b64enc }}
{{- with .Values.configs.secret.argocdServerTlsConfig }}
tls.key: {{ .key | b64enc }}
tls.crt: {{ .crt | b64enc }}
{{- end }}
{{- if .Values.configs.secret.argocdServerAdminPassword }}
admin.password: {{ .Values.configs.secret.argocdServerAdminPassword | b64enc }}

View File

@ -1,13 +1,13 @@
apiVersion: v1
{{- toYaml .Values.configs.knownHosts | nindent 0 }}
kind: ConfigMap
metadata:
name: argocd-ssh-known-hosts-cm
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "ssh-known-hosts-cm") | nindent 4 }}
{{- if .Values.configs.knownHostsAnnotations }}
{{- with .Values.configs.knownHostsAnnotations }}
annotations:
{{- range $key, $value := .Values.configs.knownHostsAnnotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
name: argocd-ssh-known-hosts-cm
{{- toYaml .Values.configs.knownHosts | nindent 0 }}

View File

@ -1,15 +1,15 @@
apiVersion: v1
{{- if .Values.configs.tlsCerts }}
{{- toYaml .Values.configs.tlsCerts | nindent 0 }}
{{- end }}
kind: ConfigMap
metadata:
name: argocd-tls-certs-cm
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "tls-certs-cm") | nindent 4 }}
{{- if .Values.configs.tlsCertsAnnotations }}
{{- with .Values.configs.tlsCertsAnnotations }}
annotations:
{{- range $key, $value := .Values.configs.tlsCertsAnnotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
name: argocd-tls-certs-cm
{{- with .Values.configs.tlsCerts }}
{{- toYaml . | nindent 0 }}
{{- end }}

View File

@ -2,12 +2,14 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "argo-cd.redis.fullname" . }}
name: {{ include "argo-cd.redis.fullname" . }}
labels:
{{- include "argo-cd.labels" (dict "context" $) | nindent 4 }}
{{- with .Values.externalRedis.secretAnnotations }}
annotations:
{{- toYaml . | nindent 4}}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
type: Opaque
data:

View File

@ -9,7 +9,9 @@ metadata:
{{- include "argo-cd.labels" (dict "context" $) | nindent 4 }}
{{- with $.Values.configs.credentialTemplatesAnnotations }}
annotations:
{{- toYaml . | nindent 4}}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
data:
{{- range $key, $value := $repo_cred_value }}

View File

@ -9,7 +9,9 @@ metadata:
{{- include "argo-cd.labels" (dict "context" $) | nindent 4 }}
{{- with $.Values.configs.repositoriesAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
data:
{{- range $key, $value := $repo_value }}