Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

ps shows healthcheck only for running container - #1675

Merged
ndeloof merged 1 commit into
docker-archive:mainfrom
ndeloof:ps_exitcode
May 17, 2021
Merged

ndeloof merged 1 commit into
docker-archive:mainfrom
ndeloof:ps_exitcode

Conversation

@ndeloof

@ndeloof ndeloof commented May 17, 2021

Copy link
Copy Markdown
Collaborator

What I did
updated ps output so

  • it does not show healthcheck status but for running container
  • it includes exit code for exited containers
  • it sort ports for predictable output

Related issue
close #1671
close #1672

@ndeloof
ndeloof requested a review from ulyssessouza May 17, 2021 07:07
@github-actions github-actions Bot added api api cli cli local Local context (moby) labels May 17, 2021
@ndeloof
ndeloof force-pushed the ps_exitcode branch 4 times, most recently from 7889adf to 6bc2845 Compare May 17, 2021 07:53
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof
ndeloof requested a review from lorenrh May 17, 2021 08:04

@lorenrh lorenrh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! 🦖

Comment thread local/compose/ps_test.go
{ID: "789", Name: "789", Project: testProject, Service: "service2", State: "Running", Health: "", Publishers: nil},
{ID: "123", Name: "123", Project: testProject, Service: "service1", State: "running", Health: "healthy", Publishers: nil},
{ID: "456", Name: "456", Project: testProject, Service: "service1", State: "running", Health: "", Publishers: []compose.PortPublisher{{URL: "localhost:80", TargetPort: 90, PublishedPort: 80}}},
{ID: "789", Name: "789", Project: testProject, Service: "service2", State: "exited", Health: "", ExitCode: 130, Publishers: nil},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should need compose.PsOptions{All: true} in order to see exited containers here ? Ah no, compose ps --all means show one-off containers, but by default in compose we list exited containers... :/

@ndeloof
ndeloof merged commit 2162bc9 into docker-archive:main May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api api cli cli local Local context (moby)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker compose ps unstable ordering in Ports column docker compose ps does not list stopped containers and their exit status

3 participants