1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05: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:
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)