mirror of https://github.com/docker/docs.git
Merge pull request #308 from vieux/filter_swarm_containers
Proposal: require ps -a to show swarm containers
This commit is contained in:
commit
2b2114e554
|
|
@ -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/{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`
|
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,10 @@ func getContainersJSON(c *context, w http.ResponseWriter, r *http.Request) {
|
||||||
if !strings.Contains(tmp.Status, "Up") && !all {
|
if !strings.Contains(tmp.Status, "Up") && !all {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// Skip swarm containers unless -a was specified.
|
||||||
|
if strings.Split(tmp.Image, ":")[0] == "swarm" && !all {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if !container.Node.IsHealthy() {
|
if !container.Node.IsHealthy() {
|
||||||
tmp.Status = "Pending"
|
tmp.Status = "Pending"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue