From 4f5f8a3961949fcfe93f9436206bd3689a19d8ff Mon Sep 17 00:00:00 2001 From: Daniel Jiang Date: Sat, 30 May 2020 14:05:39 +0800 Subject: [PATCH] Update health check script for harbor-db (#12103) This patch remove the trailing space of the hostname introduced by `hostname -i`. The trailing space will cause resolution error after this patch is applied to glibc in photon: https://github.com/vmware/photon/blob/2.0/SPECS/glibc/glibc-fix-CVE-2019-10739.patch Signed-off-by: Daniel Jiang --- make/photon/db/docker-healthcheck.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/make/photon/db/docker-healthcheck.sh b/make/photon/db/docker-healthcheck.sh index a0c93c0f7..e43ea4929 100644 --- a/make/photon/db/docker-healthcheck.sh +++ b/make/photon/db/docker-healthcheck.sh @@ -1,7 +1,8 @@ #!/bin/bash set -eo pipefail -host="$(hostname -i || echo '127.0.0.1')" +h="$(hostname -i || echo '127.0.0.1')" +host="${h%%[[:space:]]*}" #remove the trailing space user="${POSTGRES_USER:-postgres}" db="${POSTGRES_DB:-$POSTGRES_USER}" export PGPASSWORD="${POSTGRES_PASSWORD:-}"