`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:
Jessica Frazelle 2015-01-08 15:14:04 -08:00
parent 273472a5c2
commit 2639e073b1
2 changed files with 9 additions and 1 deletions

View File

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

View File

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