Added support for docker push --quiet#1221
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1221 +/- ##
==========================================
+ Coverage 54.25% 54.25% +<.01%
==========================================
Files 268 269 +1
Lines 17799 17805 +6
==========================================
+ Hits 9656 9660 +4
- Misses 7536 7538 +2
Partials 607 607 |
thaJeztah
left a comment
There was a problem hiding this comment.
Thanks! I think this needs some more changes; see my inline comment
| defer responseBody.Close() | ||
| return jsonmessage.DisplayJSONMessagesToStream(responseBody, dockerCli.Out(), nil) | ||
| if !opts.quiet { | ||
| return jsonmessage.DisplayJSONMessagesToStream(responseBody, dockerCli.Out(), nil) |
There was a problem hiding this comment.
Instead of returning nothing, we should make the output useful, so that it can be used when chaining commands (e.g. IMAGE=$(docker image push -q foobar/foo:1.1.1); docker service create --name foo $IMAGE).
See my comment here; moby/moby#13588 (comment), and this PR; #882, which is implementing this for docker image pull
There was a problem hiding this comment.
--quiet now prints the fqn for the image in the repository
silvin-lubecki
left a comment
There was a problem hiding this comment.
I'm good with the code, but I think we need a test on this feature (see cli/command/image/push_test.go) to be complete 😄
|
|
Signed-off-by: Justyn Temme <justyntemme@gmail.com>
|
Thanks for updating! Just gave this a spin; I want to briefly discuss with other people if we want the digest to be somewhere in the output, because this is the only moment where you'll be able to get the registry-digest when pushing a new image (I can see this being important for people to be able to later on verify/pull the exact same image) |
| args: []string{"--quiet", "image:tag"}, | ||
| }, | ||
| } | ||
| for _, tc := range testCases { |
There was a problem hiding this comment.
Thank you for this test! But I think you can safely remove this for pattern as you have only one test case 😸
There was a problem hiding this comment.
Thank you! Will change pr within the hour.
|
No problem at all, will edit test as requested and wait to hear back on implementation details. |
|
Is there a plan to |
Summary: I couldn't find any verbosity options in the [`docker pull` command docs](https://docs.docker.com/engine/reference/commandline/pull/), but `docker pull` [got a `--quiet` option](docker/cli#882) in a recent version (not sure if we're using that version), and `--quiet` for `docker push` [is forthcoming](docker/cli#1221). Pull Request resolved: #23111 Differential Revision: D16402993 Pulled By: kostmo fbshipit-source-id: 52f77b11b839d28f8cf1ecb58518ca69632d7fbe
|
Ping. How about this PR? Would love to see both |
|
carrying in #2197 |
|
What version was this included in? Not seeing it as a valid option in Docker version 19.03.5, build 633a0ea. |
|
It is not part of any release yet. |
|
I'd just like to "second" getting this into a released version. Our CI/CD log is chock full of pointless "Preparing" messages, etc. |
|
This will be in the upcoming 20.x release.
For CI/CD, if you don't want the output, just piping to docker pull ubuntu > /dev/null |
Signed-off-by: Justyn Temme justyntemme@gmail.com
- What I did
Added --quiet flag for docker push
Fix for #958
- How I did it
Passing a flag to either write out the content body of the response, or simply output nothing
- How to verify it
docker push --quiet tagged/image
- Description for the changelog
Added a --quiet flag for docker push
- A picture of a cute animal (not mandatory but encouraged)