From ad5040c9f479905633968eff02b2d9afbc775df3 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Fri, 21 Nov 2014 18:03:46 -0800 Subject: [PATCH] Set the container status to pending if the underlying host is not healthy Signed-off-by: Andrea Luzzardi --- api/api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/api.go b/api/api.go index b1c22f33d6..cba36a99d2 100644 --- a/api/api.go +++ b/api/api.go @@ -84,6 +84,9 @@ func getContainersJSON(c *context, w http.ResponseWriter, r *http.Request) { if !strings.Contains(tmp.Status, "Up") && !all { continue } + if !container.Node().IsHealthy() { + tmp.Status = "Pending" + } // TODO remove the Node ID in the name when we have a good solution tmp.Names = make([]string, len(container.Names)) for i, name := range container.Names {