Skip to content

Commit 066d248

Browse files
authored
[postgres] fix: add connection details to secret (CloudPirates-io#350)
1 parent 7111469 commit 066d248

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

charts/postgres/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: postgres
33
description: The World's Most Advanced Open Source Relational Database
44
type: application
5-
version: 0.8.1
5+
version: 0.8.2
66
appVersion: "18.0"
77
keywords:
88
- postgres

charts/postgres/templates/secret.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,15 @@ data:
1717
{{- if and $existingSecret $existingSecret.data }}
1818
{{- $existingPostgresPassword = index $existingSecret.data "postgres-password" }}
1919
{{- end }}
20-
postgres-password: {{ $existingPostgresPassword | default (.Values.auth.password | default (randAlphaNum 32) | b64enc) | quote }}
21-
{{- end }}
20+
{{- $postgresPassword := $existingPostgresPassword | default (.Values.auth.password | default (randAlphaNum 32) | b64enc) }}
21+
{{- $host := printf "%s.%s.svc" (include "postgres.fullname" .) .Release.Namespace }}
22+
{{- $port := .Values.service.port | toString }}
23+
{{- $username := include "postgres.username" . }}
24+
{{- $database := include "postgres.database" . }}
25+
postgres-password: {{ $postgresPassword | quote }}
26+
host: {{ $host | b64enc | quote }}
27+
port: {{ $port | b64enc | quote }}
28+
username: {{ $username | b64enc | quote }}
29+
database: {{ $database | b64enc | quote }}
30+
uri: {{ printf "postgresql://%s:%s@%s:%s/%s" $username ($postgresPassword | b64dec) $host $port $database | b64enc | quote }}
31+
{{- end }}

0 commit comments

Comments
 (0)