Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

jessfraz
Copy link
Contributor

@jessfraz jessfraz commented Jan 8, 2015

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle jess@docker.com (github: jfrazelle)


if len(filt_exited) > 0 && container.Running {
return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's the best possible fix for the issue. I would do this instead:

@@ -98,10 +98,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 !container.Running && code == container.ExitCode {
                                        should_skip = false
                                        break
                                }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, updated!

@jessfraz jessfraz force-pushed the fix-exited-filter-should-not-show-running branch from aec48e8 to 81f8402 Compare January 9, 2015 00:21
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
@crosbymichael
Copy link
Contributor

LGTM

1 similar comment
@vbatts
Copy link
Contributor

vbatts commented Jan 12, 2015

LGTM

vbatts added a commit that referenced this pull request Jan 12, 2015
…show-running

`docker ps --filter exited=status` should not show running containers
@vbatts vbatts merged commit 3ec6959 into moby:master Jan 12, 2015
@jessfraz jessfraz deleted the fix-exited-filter-should-not-show-running branch January 12, 2015 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants