mirror of
https://github.com/moby/moby.git
synced 2025-12-07 19:42:23 +03:00
docker ps --filter status=exited should not require passing -a
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
This commit is contained in:
@@ -45,6 +45,14 @@ func (daemon *Daemon) Containers(job *engine.Job) engine.Status {
|
||||
}
|
||||
}
|
||||
|
||||
if i, ok := psFilters["status"]; ok {
|
||||
for _, value := range i {
|
||||
if value == "exited" {
|
||||
all = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
names := map[string][]string{}
|
||||
daemon.ContainerGraph().Walk("/", func(p string, e *graphdb.Entity) error {
|
||||
names[e.ID()] = append(names[e.ID()], p)
|
||||
|
||||
@@ -312,7 +312,7 @@ func TestPsListContainersFilterStatus(t *testing.T) {
|
||||
secondID := stripTrailingCharacters(out)
|
||||
|
||||
// filter containers by exited
|
||||
runCmd = exec.Command(dockerBinary, "ps", "-a", "-q", "--filter=status=exited")
|
||||
runCmd = exec.Command(dockerBinary, "ps", "-q", "--filter=status=exited")
|
||||
out, _, err = runCommandWithOutput(runCmd)
|
||||
if err != nil {
|
||||
t.Fatal(out, err)
|
||||
|
||||
Reference in New Issue
Block a user