Merge branch 'master' into 'master'

Use existingSecret over password if set

See merge request ananace/charts!20
This commit is contained in:
Alexander Olofsson 2021-09-23 09:16:18 +00:00
commit 057003d38c
2 changed files with 4 additions and 6 deletions

View file

@ -81,16 +81,14 @@ spec:
-c /synapse/config/homeserver.yaml \
-c /synapse/config/conf.d/
env:
{{- $postgresPass := include "matrix-synapse.postgresql.password" . }}
{{- if and .Values.postgresql.enabled (not $postgresPass) }}
{{- if .Values.postgresql.enabled }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.postgresql.existingSecret | default (include "matrix-synapse.postgresql.fullname" .) }}
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@@"