summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-03-21 10:00:25 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-03-21 10:00:25 -0400
commit9516f28808e38f0e1c62456672f8be7a69770a89 (patch)
tree54cce75c4ec2d58cef35f312d74262bb2ef6a06f
parent97b966b851dda998e44c0722f10655bd4b911434 (diff)
downloadpodman-9516f28808e38f0e1c62456672f8be7a69770a89.tar.gz
podman-9516f28808e38f0e1c62456672f8be7a69770a89.tar.bz2
podman-9516f28808e38f0e1c62456672f8be7a69770a89.zip
Make "stopped" a valid state that maps to "exited"
Fixes #2526 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
-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"