Skip to content

Commit

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

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

* fix(cluster): make PGDBNAME optional in ping.yaml #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
UgurcanAkkok and itay-grudev authored Dec 7, 2024
1 parent 665396d commit 6198524
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 6198524

Please sign in to comment.