summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-03-21 07:47:54 -0700
committerGitHub <noreply@github.com>2019-03-21 07:47:54 -0700
commit68e3df37248da85f58662c00e0934d1359f0fdc0 (patch)
tree09a65411982a055a85b8c9e6ab7b0034f72f1578
parentf611f382d1eafaabd3b402afec210ca41422c469 (diff)
parent9516f28808e38f0e1c62456672f8be7a69770a89 (diff)
downloadpodman-68e3df37248da85f58662c00e0934d1359f0fdc0.tar.gz
podman-68e3df37248da85f58662c00e0934d1359f0fdc0.tar.bz2
podman-68e3df37248da85f58662c00e0934d1359f0fdc0.zip
Merge pull request #2732 from mheon/closed_is_exited
Make "stopped" a valid state that maps to "exited"
-rw-r--r--cmd/podman/ps.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index ad942da2e..20638b424 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -423,7 +423,7 @@ func generateContainerFilterFuncs(filter, filterValue string, runtime *libpod.Ru
return false
}, nil
case "status":
- if !util.StringInSlice(filterValue, []string{"created", "running", "paused", "exited", "unknown"}) {
+ if !util.StringInSlice(filterValue, []string{"created", "running", "paused", "stopped", "exited", "unknown"}) {
return nil, errors.Errorf("%s is not a valid status", filterValue)
}
return func(c *libpod.Container) bool {
@@ -431,6 +431,9 @@ func generateContainerFilterFuncs(filter, filterValue string, runtime *libpod.Ru
if err != nil {
return false
}
+ if filterValue == "stopped" {
+ filterValue = "exited"
+ }
state := status.String()
if status == libpod.ContainerStateConfigured {
state = "created"