feat: Lookup referenced configmaps

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
This commit is contained in:
Oliver Bähler 2021-04-21 18:15:58 +02:00
parent abcd61717f
commit a10982af94
No known key found for this signature in database
GPG key ID: 7AE0B2618ECDC1B6
2 changed files with 10 additions and 7 deletions

View file

@ -2,7 +2,7 @@ apiVersion: v2
name: argocd-applicationset
description: A Helm chart for installing ArgoCD ApplicationSet
type: application
version: 0.1.3
version: 0.2.0
appVersion: "v0.1.0"
home: https://github.com/argoproj/argo-helm
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png

View file

@ -1,3 +1,6 @@
{{- $knownHosts := (lookup "v1" "ConfigMap" .Release.Namespace "argocd-ssh-known-hosts-cm") -}}
{{- $tlsCerts := (lookup "v1" "ConfigMap" .Release.Namespace "argocd-tls-certs-cm") -}}
{{- $gpgKeys:= (lookup "v1" "ConfigMap" .Release.Namespace "argocd-gpg-keys-cm") -}}
apiVersion: apps/v1
kind: Deployment
metadata:
@ -50,15 +53,15 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
{{- if .Values.mountSSHKnownHostsVolume }}
{{- if and $knownHosts .Values.mountSSHKnownHostsVolume }}
- mountPath: /app/config/ssh
name: ssh-known-hosts
{{- end }}
{{- if .Values.mountTLSCertsVolume }}
{{- if and $tlsCerts .Values.mountTLSCertsVolume }}
- mountPath: /app/config/tls
name: tls-certs
{{- end }}
{{- if .Values.mountGPGKeysVolume }}
{{- if and $gpgKeys .Values.mountGPGKeysVolume }}
- mountPath: /app/config/gpg/source
name: gpg-keys
{{- end }}
@ -67,17 +70,17 @@ spec:
name: gpg-keyring
{{- end }}
volumes:
{{- if .Values.mountSSHKnownHostsVolume }}
{{- if and $knownHosts .Values.mountSSHKnownHostsVolume }}
- configMap:
name: argocd-ssh-known-hosts-cm
name: ssh-known-hosts
{{- end }}
{{- if .Values.mountTLSCertsVolume }}
{{- if and $tlsCerts .Values.mountTLSCertsVolume }}
- configMap:
name: argocd-tls-certs-cm
name: tls-certs
{{- end }}
{{- if .Values.mountGPGKeysVolume }}
{{- if and $gpgKeys .Values.mountGPGKeysVolume }}
- configMap:
name: argocd-gpg-keys-cm
name: gpg-keys