Carry #10255: Docker ps format#14699
Conversation
73012f1 to
5eb3d74
Compare
cliconfig/config.go
Outdated
There was a problem hiding this comment.
I'm not sure we should have this here since this info, I think, is just specific for one command and should probably live in the ps.go file. If we ever get to the point where each command is an independent exe then the common/config-info shouldn't have any cmd specific info as that would break composibility.
Is there any reason this must be in here instead of ps.go?
There was a problem hiding this comment.
never mind - I see now that this is part of the config file - so this makes sense!
|
thanks for adding all those tests ❤️ LGTM |
There was a problem hiding this comment.
Can we add a test with multiple Names to verify that with --no-trunc we see 'em all but w/o it we only see one?
|
Just one suggestion about an additional test but aside from that LGTM! |
|
@duglin FYI--test added for mutli-names with |
|
@estesp it looks like there is a racy test. Maps are not guaranteed to be ordered. |
There was a problem hiding this comment.
I looked and I couldn't find a test that used --link and didn't use --no-trunc - do you see one? If not it might be good to add one.
There was a problem hiding this comment.
I've updated the test to do both given we already have linked containers running in the same test
* api/client/ps.go: Refactor CmdPs to use a fields list of characters to determine which columns to print on `docker ps` invocation. This adds an ability for the docker command to print the columns of output in arbitrary order. Signed-off-by: Jeff Mickey <[email protected]> Docker-DCO-1.1-Signed-off-by: Jeff Mickey <[email protected]>
Docker-DCO-1.1-Signed-off-by: David Calavera <[email protected]>
|
@calavera thanks for catching that; I've updated the test to use maps with |
|
@estesp can you please add the same documentation to |
|
@SvenDowideit good catch; I've added text to |
|
code LGTM |
docs/reference/commandline/cli.md
Outdated
There was a problem hiding this comment.
Could you add a reference here / describe that the psFormat is a string containing a Go template?
There was a problem hiding this comment.
Perhaps a link to the Formatting section in ps.md is actually best; it describes the format in detail
|
@estesp I'm +1 on removing |
|
It looks like everyone agrees to remove |
Re-add the docs from @calavera's PR to the moved cli cmd reference docs. Fix gofmt and vet issues from carried commits Add integration test for using format with --no-trunc and multi-names Fix custom_test map order dependency on expected value check Add docs to reference/commandline/ps.md Remove "-F" flag option from original carried PR content Docker-DCO-1.1-Signed-off-by: Phil Estes <[email protected]> (github: estesp)
|
Thanks everyone-- |
|
Thanks @estesp! re-LGTM for the docs (and removal of |
|
LGTM |
Carry #10255: Docker ps format
|
🎉 💃 |
There was a problem hiding this comment.
We're getting a side-effect from this PR (and I think it's this specific line causing it) where docker ps when you have no containers now prints a single blank line instead of an empty header row (like docker ps used to and docker images still does).
There was a problem hiding this comment.
I have an idea to fix it and am working on a PR now.
|
@calavera can we have the same in images :D |
|
@vieux PRs are always welcome 😉 |
|
@tianon is #14699 (comment) still an issue? |
|
@thaJeztah that problem was fixed in #14919 |
|
@vieux so needy! 😝 However, I'm pretty sure we can make that logic work for several commands with a couple of interfaces more. |
|
thanks @estesp! I noticed the comment, but no PR linked |
|
@vieux oops, never mind - slightly different |
Include original #10255 PR content, replace field selection/output implementation with Go template version from @calavera PR #12931