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:
parent
273472a5c2
commit
2639e073b1
2 changed files with 9 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue