From d68a18365c71b6feb4cc05e77e3028cb3e92b1b1 Mon Sep 17 00:00:00 2001 From: Boris Komraz Date: Sat, 21 Oct 2023 19:48:09 +0300 Subject: [PATCH] render values by tpl function Signed-off-by: Boris Komraz --- charts/argo-cd/Chart.yaml | 6 +++--- charts/argo-cd/templates/_helpers.tpl | 2 +- charts/argo-cd/templates/argocd-configs/argocd-rbac-cm.yaml | 2 +- charts/argo-cd/templates/argocd-server/ingress-grpc.yaml | 4 ++-- charts/argo-cd/templates/argocd-server/ingress.yaml | 4 ++-- charts/argo-cd/values.yaml | 4 ++++ 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 5f437944..f5f50f77 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -3,7 +3,7 @@ appVersion: v2.8.4 kubeVersion: ">=1.23.0-0" description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 5.46.8 +version: 5.46.9 home: https://github.com/argoproj/argo-helm icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png sources: @@ -26,5 +26,5 @@ annotations: fingerprint: 2B8F22F57260EFA67BE1C5824B11F800CD9D2252 url: https://argoproj.github.io/argo-helm/pgp_keys.asc artifacthub.io/changes: | - - kind: fixed - description: Sync redis / redis-ha readOnlyRootFilesystem=true option from upstream. This was part of Argo CD 2.8.0. + - kind: added + description: Added tpl rendering for following chart values: server.ingress.annotations, server.ingress.hosts, server.ingressGrpc.annotations, server.ingressGrpc.hosts, server.config diff --git a/charts/argo-cd/templates/_helpers.tpl b/charts/argo-cd/templates/_helpers.tpl index b5d62a6a..0c034e92 100644 --- a/charts/argo-cd/templates/_helpers.tpl +++ b/charts/argo-cd/templates/_helpers.tpl @@ -176,7 +176,7 @@ Merge Argo Configuration with Preset Configuration {{- $config := (mergeOverwrite (deepCopy (omit .Values.configs.cm "create" "annotations")) (.Values.server.config | default dict)) -}} {{- $preset := include "argo-cd.config.cm.presets" . | fromYaml | default dict -}} {{- range $key, $value := mergeOverwrite $preset $config }} -{{- $fmted := $value | toString }} +{{- $fmted := tpl ($value | toString) $ }} {{- if not (eq $fmted "") }} {{ $key }}: {{ $fmted | toYaml }} {{- end }} diff --git a/charts/argo-cd/templates/argocd-configs/argocd-rbac-cm.yaml b/charts/argo-cd/templates/argocd-configs/argocd-rbac-cm.yaml index c882cb39..8ef46d63 100644 --- a/charts/argo-cd/templates/argocd-configs/argocd-rbac-cm.yaml +++ b/charts/argo-cd/templates/argocd-configs/argocd-rbac-cm.yaml @@ -14,6 +14,6 @@ metadata: {{- end }} {{- with (mergeOverwrite (deepCopy (omit .Values.configs.rbac "create" "annotations")) (.Values.server.rbacConfig | default dict)) }} data: - {{- toYaml . | nindent 2 }} + {{- tpl (toYaml .) $ | nindent 2 }} {{- end }} {{- end }} diff --git a/charts/argo-cd/templates/argocd-server/ingress-grpc.yaml b/charts/argo-cd/templates/argocd-server/ingress-grpc.yaml index b671f86f..4f933ab3 100644 --- a/charts/argo-cd/templates/argocd-server/ingress-grpc.yaml +++ b/charts/argo-cd/templates/argocd-server/ingress-grpc.yaml @@ -16,7 +16,7 @@ metadata: {{- with .Values.server.ingressGrpc.annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ $value | quote }} + {{ $key }}: {{ tpl $value $ | quote }} {{- end }} {{- end }} spec: @@ -26,7 +26,7 @@ spec: rules: {{- if .Values.server.ingressGrpc.hosts }} {{- range $host := .Values.server.ingressGrpc.hosts }} - - host: {{ $host }} + - host: {{ tpl $host $ }} http: paths: {{- with $extraPaths }} diff --git a/charts/argo-cd/templates/argocd-server/ingress.yaml b/charts/argo-cd/templates/argocd-server/ingress.yaml index a142bb66..c1fd828e 100644 --- a/charts/argo-cd/templates/argocd-server/ingress.yaml +++ b/charts/argo-cd/templates/argocd-server/ingress.yaml @@ -16,7 +16,7 @@ metadata: {{- if .Values.server.ingress.annotations }} annotations: {{- range $key, $value := .Values.server.ingress.annotations }} - {{ $key }}: {{ $value | quote }} + {{ $key }}: {{ tpl $value $ | quote }} {{- end }} {{- if and .Values.server.ingressGrpc.isAWSALB .Values.server.ingressGrpc.enabled }} alb.ingress.kubernetes.io/conditions.{{ template "argo-cd.server.fullname" . }}-grpc: | @@ -30,7 +30,7 @@ spec: rules: {{- if .Values.server.ingress.hosts }} {{- range $host := .Values.server.ingress.hosts }} - - host: {{ $host | quote }} + - host: {{ tpl $host $ | quote }} http: paths: {{- with $extraPaths }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index b029dfaa..5d58cd31 100644 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -1898,6 +1898,7 @@ server: # -- Enable an ingress resource for the Argo CD server enabled: false # -- Additional ingress annotations + ## Annotation values may reference other values by {{ .Values.otherValue }} (be sure protect by quotation marks) annotations: {} # -- Additional ingress labels labels: {} @@ -1908,6 +1909,7 @@ server: ## Argo Ingress. ## Hostnames must be provided if Ingress is enabled. ## Secrets must be manually created in the namespace + ## Hosts value may reference other values by {{ .Values.otherValue }} (be sure protect by quotation marks) hosts: [] # - argocd.example.com @@ -1943,6 +1945,7 @@ server: # -- Setup up gRPC ingress to work with an AWS ALB isAWSALB: false # -- Additional ingress annotations for dedicated [gRPC-ingress] + ## Annotations values may reference other values by {{ .Values.otherValue }} (be sure protect by quotation marks) annotations: {} # -- Additional ingress labels for dedicated [gRPC-ingress] labels: {} @@ -1965,6 +1968,7 @@ server: ## Argo Ingress. ## Hostnames must be provided if Ingress is enabled. ## Secrets must be manually created in the namespace + ## Hosts value may reference other values by {{ .Values.otherValue }} (be sure protect by quotation marks) ## hosts: [] # - argocd.example.com