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

View file

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