mirror of
https://github.com/bitnami/charts.git
synced 2026-02-25 07:38:03 +08:00
[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:
@@ -26,4 +26,4 @@ name: postgresql
|
||||
sources:
|
||||
- https://github.com/bitnami/bitnami-docker-postgresql
|
||||
- https://www.postgresql.org/
|
||||
version: 10.3.7
|
||||
version: 10.3.8
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -176,7 +176,7 @@ spec:
|
||||
value: {{ template "common.names.fullname" . }}
|
||||
- name: POSTGRES_MASTER_PORT_NUMBER
|
||||
value: {{ include "postgresql.port" . | quote }}
|
||||
{{- if and (not (eq .Values.postgresqlUsername "postgres")) (or .Values.postgresqlPostgresPassword (include "postgresql.useExistingSecret" .)) }}
|
||||
{{- if not (eq (include "postgresql.username" .) "postgres") }}
|
||||
{{- if .Values.usePasswordFile }}
|
||||
- name: POSTGRES_POSTGRES_PASSWORD_FILE
|
||||
value: "/opt/bitnami/postgresql/secrets/postgresql-postgres-password"
|
||||
|
||||
Reference in New Issue
Block a user