Merge pull request #14682 from ninjadq/hostname_hardcode_to_localhost

Fix: Use local host on db's healthcheck
This commit is contained in:
Wenkai Yin(尹文开) 2021-04-19 21:02:31 +08:00 committed by GitHub
commit 0f6692f68f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,7 @@
#!/bin/bash #!/bin/bash
set -eo pipefail set -eo pipefail
h="$(hostname -i || echo '127.0.0.1')" host="localhost"
host="${h%%[[:space:]]*}" #remove the trailing space
user="${POSTGRES_USER:-postgres}" user="${POSTGRES_USER:-postgres}"
db="${POSTGRES_DB:-$POSTGRES_USER}" db="${POSTGRES_DB:-$POSTGRES_USER}"
export PGPASSWORD="${POSTGRES_PASSWORD:-}" export PGPASSWORD="${POSTGRES_PASSWORD:-}"