From 621710929063e1765ad85486dc850ccef30536e3 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Thu, 22 Jun 2023 09:02:56 +0200 Subject: [PATCH] layer0-web: Set values from environment if they exist --- .../all/charts/layer0-web/templates/configmap.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rds/base/charts/all/charts/layer0-web/templates/configmap.yaml b/rds/base/charts/all/charts/layer0-web/templates/configmap.yaml index 44a05c6..54746c5 100644 --- a/rds/base/charts/all/charts/layer0-web/templates/configmap.yaml +++ b/rds/base/charts/all/charts/layer0-web/templates/configmap.yaml @@ -39,6 +39,18 @@ data: {{- end }} PROMETHEUS_MULTIPROC_DIR: "/tmp" --- +{{- range $domain := $domains }} + {{- $name := $domain.name -}} + {{- $upper_name := $name | upper | replace "." "_" -}} + {{- $client_id := printf "%s_%s" $upper_name "OAUTH_CLIENT_ID" }} + {{- $client_secret := printf "%s_%s" $upper_name "OAUTH_CLIENT_SECRET" }} + {{- if hasKey $.Values.environment $client_id }} + {{ set $domain "OAUTH_CLIENT_ID" (get $.Values.environment $client_id) }} + {{- end }} + {{- if hasKey $.Values.environment $client_secret }} + {{ set $domain "OAUTH_CLIENT_SECRET" (get $.Values.environment $client_secret) }} + {{- end }} +{{- end }} apiVersion: v1 kind: ConfigMap metadata: