From 99bd1199906ee494df392009bfbb96c59486485c Mon Sep 17 00:00:00 2001 From: fkf9 Date: Thu, 16 Sep 2021 14:26:48 +0200 Subject: [PATCH 1/3] Use ENV var if existingSecret is set --- charts/matrix-synapse/templates/deployment.yaml | 4 ++-- charts/matrix-synapse/templates/secrets.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/matrix-synapse/templates/deployment.yaml b/charts/matrix-synapse/templates/deployment.yaml index cb0e7b4..14f2f2a 100644 --- a/charts/matrix-synapse/templates/deployment.yaml +++ b/charts/matrix-synapse/templates/deployment.yaml @@ -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: diff --git a/charts/matrix-synapse/templates/secrets.yaml b/charts/matrix-synapse/templates/secrets.yaml index 3cdb3ed..8fcd9fa 100644 --- a/charts/matrix-synapse/templates/secrets.yaml +++ b/charts/matrix-synapse/templates/secrets.yaml @@ -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@@" From 3facf3c73cb27a3bcf5233bbcf8c399400a50c20 Mon Sep 17 00:00:00 2001 From: fkf9 Date: Thu, 16 Sep 2021 14:43:30 +0200 Subject: [PATCH 2/3] Remove unecessary variables --- charts/matrix-synapse/templates/deployment.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/charts/matrix-synapse/templates/deployment.yaml b/charts/matrix-synapse/templates/deployment.yaml index 14f2f2a..ffbce2e 100644 --- a/charts/matrix-synapse/templates/deployment.yaml +++ b/charts/matrix-synapse/templates/deployment.yaml @@ -81,15 +81,13 @@ spec: -c /synapse/config/homeserver.yaml \ -c /synapse/config/conf.d/ env: -{{- $postgresPass := include "matrix-synapse.postgresql.password" . }} - {{- if and .Values.postgresql.enabled }} + {{- 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) }} - name: REDIS_PASSWORD valueFrom: From 943c54b1c14978dc14ed6f7a14a2da29a640e9a1 Mon Sep 17 00:00:00 2001 From: fkf9 Date: Thu, 16 Sep 2021 15:24:50 +0200 Subject: [PATCH 3/3] remove useless space --- charts/matrix-synapse/templates/secrets.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/matrix-synapse/templates/secrets.yaml b/charts/matrix-synapse/templates/secrets.yaml index 8fcd9fa..2f15d67 100644 --- a/charts/matrix-synapse/templates/secrets.yaml +++ b/charts/matrix-synapse/templates/secrets.yaml @@ -44,7 +44,7 @@ stringData: name: "psycopg2" args: user: {{ $postgresUser | quote }} - {{- if and $postgresPass (not .Values.postgresql.existingSecret) }} + {{- if and $postgresPass (not .Values.postgresql.existingSecret) }} password: {{ $postgresPass | quote }} {{- else }} password: "@@POSTGRES_PASSWORD@@"