From a10982af94eb95cd6175d8dd562560902e676cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Wed, 21 Apr 2021 18:15:58 +0200 Subject: [PATCH] feat: Lookup referenced configmaps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Oliver Bähler --- charts/argocd-applicationset/Chart.yaml | 2 +- .../templates/deployment.yaml | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/charts/argocd-applicationset/Chart.yaml b/charts/argocd-applicationset/Chart.yaml index ebb5ee1c..902bb109 100644 --- a/charts/argocd-applicationset/Chart.yaml +++ b/charts/argocd-applicationset/Chart.yaml @@ -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 diff --git a/charts/argocd-applicationset/templates/deployment.yaml b/charts/argocd-applicationset/templates/deployment.yaml index d2cd345c..afbf9d4a 100644 --- a/charts/argocd-applicationset/templates/deployment.yaml +++ b/charts/argocd-applicationset/templates/deployment.yaml @@ -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