From dab314900daf2368eb323e35b68e77de2d2740f5 Mon Sep 17 00:00:00 2001 From: Nitish Tiwari Date: Sat, 23 Feb 2019 23:02:53 +0530 Subject: [PATCH] Fix healthcheck script to wait for netstat command output (#7275) Fixes #7272 --- dockerscripts/healthcheck.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dockerscripts/healthcheck.go b/dockerscripts/healthcheck.go index 376b2f26c..c23b6e726 100755 --- a/dockerscripts/healthcheck.go +++ b/dockerscripts/healthcheck.go @@ -83,6 +83,11 @@ func findEndpoint() string { if strings.Count(addr, ":") > 0 { addr = strings.Join([]string{"[", addr, "]"}, "") } + // wait for cmd to complete before return + if err = cmd.Wait(); err != nil { + // command failed to run + log.Fatal(err.Error()) + } // return joint address and port return strings.Join([]string{addr, port}, ":") }