mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 15:28:35 +00:00
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:
+2
-3
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user