Skip to content

Commit

Permalink
Allow use of alternate postgresql port
Browse files Browse the repository at this point in the history
The PostgreSQL port can be different than the standard one, especially
when using an external service.

Signed-off-by: Christophe Aubry <[email protected]>
  • Loading branch information
Christophe Aubry committed Feb 27, 2024
1 parent f962041 commit 941a0e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,20 @@ spec:
apt update
apt install -y postgresql-client
cat <<-EOF > /tmp/.pgpass
${DATASOURCES_DEFAULT_HOST}:5432:*:${DATASOURCES_DEFAULT_USERNAME}:${DATASOURCES_DEFAULT_PASSWORD}
${DATASOURCES_DEFAULT_HOST}:${DATASOURCES_DEFAULT_PORT}:*:${DATASOURCES_DEFAULT_USERNAME}:${DATASOURCES_DEFAULT_PASSWORD}
EOF
chmod 600 /tmp/.pgpass
export PGPASSFILE='/tmp/.pgpass'
while ! ${client} -h ${DATASOURCES_DEFAULT_HOST} ; do
while ! ${client} -h ${DATASOURCES_DEFAULT_HOST} -p ${DATASOURCES_DEFAULT_PORT} ; do
echo "Waiting for postgresql database connection..."
sleep 2
done
{{- end }}
env:
- name: DATASOURCES_DEFAULT_HOST
value: {{ include "passbolt.databaseServiceName" . }}
- name: DATASOURCES_DEFAULT_PORT
value: {{ .Values.passboltEnv.plain.DATASOURCES_DEFAULT_PORT }}
{{- with .Values.passboltEnv.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down

0 comments on commit 941a0e8

Please sign in to comment.