docker ps --filter exited=status should not show running containers

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
This commit is contained in:
Jessica Frazelle
2015-01-08 16:23:54 -08:00
parent 273472a5c2
commit 81f84023be
2 changed files with 15 additions and 14 deletions
+2 -3
View File
@@ -73,7 +73,6 @@ func (daemon *Daemon) Containers(job *engine.Job) engine.Status {
if !container.Running && !all && n <= 0 && since == "" && before == "" {
return nil
}
if !psFilters.Match("name", container.Name) {
return nil
}
@@ -96,10 +95,10 @@ func (daemon *Daemon) Containers(job *engine.Job) engine.Status {
return errLast
}
}
if len(filt_exited) > 0 && !container.Running {
if len(filt_exited) > 0 {
should_skip := true
for _, code := range filt_exited {
if code == container.ExitCode {
if code == container.ExitCode && !container.Running {
should_skip = false
break
}