Skip to content

Commit

Permalink
add PGDBNAME to database-ping-test (cloudnative-pg#369)
Browse files Browse the repository at this point in the history
* add PGDBNAME to database-ping-test cloudnative-pg#368

Signed-off-by: Uğurcan Akkök <[email protected]>

* fix(cluster): make PGDBNAME optional in ping.yaml cloudnative-pg#368

Signed-off-by: Uğurcan Akkök <[email protected]>

---------

Signed-off-by: Uğurcan Akkök <[email protected]>
Co-authored-by: Itay Grudev <[email protected]>
  • Loading branch information
2 people authored and hapeho committed Dec 18, 2024
1 parent 78a21ae commit 7f8ec26
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion charts/cluster/templates/tests/ping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ spec:
secretKeyRef:
name: {{ include "cluster.fullname" . }}-app
key: password
- name: PGDBNAME
valueFrom:
secretKeyRef:
name: {{ include "cluster.fullname" . }}-app
key: dbname
optional: true
args:
- "-c"
- >-
apk add postgresql-client &&
psql "postgresql://$PGUSER:$PGPASS@{{ include "cluster.fullname" . }}-rw.{{ .Release.Namespace }}.svc.cluster.local:5432" -c 'SELECT 1'
psql "postgresql://$PGUSER:$PGPASS@{{ include "cluster.fullname" . }}-rw.{{ .Release.Namespace }}.svc.cluster.local:5432/${PGDBNAME:-$PGUSER}" -c 'SELECT 1'

0 comments on commit 7f8ec26

Please sign in to comment.