mirror of
https://github.com/containers/podman.git
synced 2025-06-22 18:08:11 +08:00
Make "stopped" a valid state that maps to "exited"
Fixes #2526 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
@ -423,7 +423,7 @@ func generateContainerFilterFuncs(filter, filterValue string, runtime *libpod.Ru
|
|||||||
return false
|
return false
|
||||||
}, nil
|
}, nil
|
||||||
case "status":
|
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 nil, errors.Errorf("%s is not a valid status", filterValue)
|
||||||
}
|
}
|
||||||
return func(c *libpod.Container) bool {
|
return func(c *libpod.Container) bool {
|
||||||
@ -431,6 +431,9 @@ func generateContainerFilterFuncs(filter, filterValue string, runtime *libpod.Ru
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if filterValue == "stopped" {
|
||||||
|
filterValue = "exited"
|
||||||
|
}
|
||||||
state := status.String()
|
state := status.String()
|
||||||
if status == libpod.ContainerStateConfigured {
|
if status == libpod.ContainerStateConfigured {
|
||||||
state = "created"
|
state = "created"
|
||||||
|
Reference in New Issue
Block a user