From fb167e951194e849c41db3bbb796f5e0f6ecd04f Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Tue, 27 Jan 2015 00:41:11 +0000 Subject: [PATCH] require ps -a to show swarm containers Signed-off-by: Victor Vieux --- api/README.md | 7 +++++-- api/api.go | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/README.md b/api/README.md index 4496992c6e..e560083f00 100644 --- a/api/README.md +++ b/api/README.md @@ -49,6 +49,9 @@ DELETE "/images/{name:.*}" ``` * `GET "/containers/{name:.*}/json"`: `HostIP` replaced by the the actual Node's IP if `HostIP` is `0.0.0.0` -* `GET "/containers"/json"`: Node's name prepended to the container name. +* `GET "/containers/json"`: Node's name prepended to the container name. + +* `GET "/containers/json"`: `HostIP` replaced by the the actual Node's IP if `HostIP` is `0.0.0.0` + +* `GET "/containers/json"` : Containers started from the `swarm` official image are hidden by default, use `all=1` to display them. -* `GET "/containers"/json"`: `HostIP` replaed by the the actual Node's IP if `HostIP` is `0.0.0.0` diff --git a/api/api.go b/api/api.go index e003faffa0..9e506368c9 100644 --- a/api/api.go +++ b/api/api.go @@ -136,6 +136,10 @@ func getContainersJSON(c *context, w http.ResponseWriter, r *http.Request) { if !strings.Contains(tmp.Status, "Up") && !all { continue } + // Skip swarm containers unless -a was specified. + if strings.Split(tmp.Image, ":")[0] == "swarm" && !all { + continue + } if !container.Node.IsHealthy() { tmp.Status = "Pending" }