Merge pull request #2732 from mheon/closed_is_exited

Make "stopped" a valid state that maps to "exited"
This commit is contained in:
OpenShift Merge Robot
2019-03-21 07:47:54 -07:00
committed by GitHub

View File

@ -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"