summaryrefslogtreecommitdiff
path: root/cmd/podman/ps.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-03-08 09:55:39 -0500
committerMatthew Heon <matthew.heon@pm.me>2019-03-08 09:55:39 -0500
commitfbd8f33a59f18d48df5c3e07d9dab87fe788bcf0 (patch)
tree8fc56a13c2ad74d67927e040bb8f4eda520de238 /cmd/podman/ps.go
parent9e2cd7fea1c03e36c9354c8f67a4f08721fdc503 (diff)
downloadpodman-fbd8f33a59f18d48df5c3e07d9dab87fe788bcf0.tar.gz
podman-fbd8f33a59f18d48df5c3e07d9dab87fe788bcf0.tar.bz2
podman-fbd8f33a59f18d48df5c3e07d9dab87fe788bcf0.zip
Remove 'podman ps' restarting filter and fix stopped
Podman has no concept of a "restarting" container - such a container is just transitioning from running to stopped and then back to running through our ordinary state machine. As such, filtering "restarting" containers doesn't work and does nothing. Also, make "stopped" containers show as exited - this is a momentary state we transition to before proper exited. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman/ps.go')
-rw-r--r--cmd/podman/ps.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index 9793d67f8..6caac2406 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -419,7 +419,7 @@ func generateContainerFilterFuncs(filter, filterValue string, runtime *libpod.Ru
return false
}, nil
case "status":
- if !util.StringInSlice(filterValue, []string{"created", "restarting", "running", "paused", "exited", "unknown"}) {
+ if !util.StringInSlice(filterValue, []string{"created", "running", "paused", "exited", "unknown"}) {
return nil, errors.Errorf("%s is not a valid status", filterValue)
}
return func(c *libpod.Container) bool {
@@ -430,6 +430,8 @@ func generateContainerFilterFuncs(filter, filterValue string, runtime *libpod.Ru
state := status.String()
if status == libpod.ContainerStateConfigured {
state = "created"
+ } else if status == libpod.ContainerStateStopped {
+ state = "exited"
}
return state == filterValue
}, nil