-{{- if not .Values.existingSecret }}
+{{- if (include "postgresql.createSecret" .) }}
apiVersion: v1
kind: Secret
metadata:
heritage: {{ .Release.Service | quote }}
type: Opaque
data:
- {{- if .Values.postgresqlPassword }}
- postgresql-password: {{ .Values.postgresqlPassword | b64enc | quote }}
- {{- else }}
- postgresql-password: {{ randAlphaNum 10 | b64enc | quote }}
+ {{- if and .Values.postgresqlPostgresPassword (not (eq .Values.postgresqlUsername "postgres")) }}
+ postgresql-postgres-password: {{ include "postgresql.postgres.password" . | b64enc | quote }}
{{- end }}
+ postgresql-password: {{ include "postgresql.password" . | b64enc | quote }}
{{- if .Values.replication.enabled }}
- {{- if .Values.replication.password }}
- postgresql-replication-password: {{ .Values.replication.password | b64enc | quote }}
- {{- else }}
- postgresql-replication-password: {{ randAlphaNum 10 | b64enc | quote }}
+ postgresql-replication-password: {{ include "postgresql.replication.password" . | b64enc | quote }}
{{- end }}
+ {{- if (and .Values.ldap.enabled .Values.ldap.bind_password)}}
+ postgresql-ldap-password: {{ .Values.ldap.bind_password | b64enc | quote }}
{{- end }}
{{- end -}}