[bitnami/postgresql] Don't put postgresql-postgres-password in secret when not needed (#5635)

* Don't put postgresql-postgres-password in secret when not needed

When only using the "postgres" user, the secret gets updated every helm upgrade with a
random string. When using with argocd (and maybe other gitops tools) there are always
changes until you put a dummy value into postgresqlPostgresPassword.

Use the same conditional as in statefulset.yaml:
~~~
{{- if not (eq (include "postgresql.username" .) "postgres")  }}
  # (..)
- name: POSTGRES_POSTGRES_PASSWORD
  valueFrom:
    secretKeyRef:
      name: {{ template "postgresql.secretName" . }}
      key: postgresql-postgres-password
{{- end }}
{{- end }}
~~~

* Use same conditional for readreplicas

In PR #4380 we forgot to also change the 2nd statefulset for the readreplicas
This commit is contained in:
Marco Kilchhofer
2021-03-03 12:24:44 +01:00
committed by GitHub
parent c733816381
commit db08f68c1b
3 changed files with 4 additions and 2 deletions

View File

@@ -11,7 +11,9 @@ metadata:
namespace: {{ .Release.Namespace }}
type: Opaque
data:
{{- if not (eq (include "postgresql.username" .) "postgres") }}
postgresql-postgres-password: {{ include "postgresql.postgres.password" . | b64enc | quote }}
{{- end }}
postgresql-password: {{ include "postgresql.password" . | b64enc | quote }}
{{- if .Values.replication.enabled }}
postgresql-replication-password: {{ include "postgresql.replication.password" . | b64enc | quote }}