layer0-web: Make sure that environment variables are set

If the corresponding secrets exist, we put them in the environment
This commit is contained in:
Micke Nordin 2023-06-22 09:45:15 +02:00
parent 6217109290
commit b5cc15a319
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257

View file

@ -35,6 +35,26 @@ spec:
mountPath: /srv/domains.json
subPath: domains.json
readOnly: true
{{- if.Values.global.domains }}
env:
{{- range $domain := .Values.global.domains }}
{{- $name := $domain.name -}}
{{- $upper_name := upper $name | replace "." "_" -}}
{{- $lower_name := lower $name | replace "." "-" -}}
{{- $client_id := printf "%s_%s" $upper_name "OAUTH_CLIENT_ID" }}
{{- $client_secret := printf "%s_%s" $upper_name "OAUTH_CLIENT_SECRET" }}
- name: {{ $client_id }}
valueFrom:
secretKeyRef:
name: layer1-port-owncloud-{{ $lower_name }}
key: oauth-client-id
- name: {{ $client_secret }}
valueFrom:
secretKeyRef:
name: layer1-port-owncloud-{{ $lower_name }}
key: oauth-client-secret
{{- end }}
{{- end }}
envFrom:
- configMapRef:
name: mservice