Use ENV var if existingSecret is set

This commit is contained in:
fkf9 2021-09-16 14:26:48 +02:00
parent 0f448b1e3e
commit 99bd119990
2 changed files with 4 additions and 4 deletions

View file

@ -82,7 +82,7 @@ spec:
-c /synapse/config/conf.d/
env:
{{- $postgresPass := include "matrix-synapse.postgresql.password" . }}
{{- if and .Values.postgresql.enabled (not $postgresPass) }}
{{- if and .Values.postgresql.enabled }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
@ -90,7 +90,7 @@ spec:
key: postgresql-password
{{- end }}
{{- $redisPass := include "matrix-synapse.redis.password" . }}
{{- if and .Values.redis.enabled (default .Values.redis.usePassword true) (not $redisPass) }}
{{- if and .Values.redis.enabled (default .Values.redis.usePassword true) }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:

View file

@ -44,7 +44,7 @@ stringData:
name: "psycopg2"
args:
user: {{ $postgresUser | quote }}
{{- if $postgresPass }}
{{- if and $postgresPass (not .Values.postgresql.existingSecret) }}
password: {{ $postgresPass | quote }}
{{- else }}
password: "@@POSTGRES_PASSWORD@@"
@ -67,7 +67,7 @@ stringData:
enabled: true
host: {{ $redisHost | quote }}
{{- if or .Values.redis.usePassword .Values.redis.password .Values.externalRedis.password }}
{{- if $redisPass }}
{{- if and $redisPass (not .Values.redis.existingSecret) }}
password: {{ $redisPass | quote }}
{{- else }}
password: "@@REDIS_PASSWORD@@"