summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpod/healthcheck.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/libpod/healthcheck.go b/libpod/healthcheck.go
index e9bf984e2..8ed2b12e1 100644
--- a/libpod/healthcheck.go
+++ b/libpod/healthcheck.go
@@ -123,6 +123,9 @@ func (c *Container) runHealthCheck() (HealthCheckStatus, error) {
// command supplied on command line - pass as-is
newCommand = hcCommand
}
+ if len(newCommand) < 1 || newCommand[0] == "" {
+ return HealthCheckNotDefined, errors.Errorf("container %s has no defined healthcheck", c.ID())
+ }
captureBuffer := bufio.NewWriter(&capture)
hcw := hcWriteCloser{
captureBuffer,