mirror of
https://github.com/docker/cli.git
synced 2026-09-28 10:15:56 -04:00
Add option to pull images quietly
Add `--quiet` to the `docker image pull` subcommand that will not pull the image quietly. ``` $ docker pull -q golang Using default tag: latest ``` Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
|
||||
"github.com/docker/cli/e2e/internal/fixtures"
|
||||
"github.com/docker/cli/internal/test/environment"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
"gotest.tools/golden"
|
||||
"gotest.tools/icmd"
|
||||
"gotest.tools/skip"
|
||||
@@ -32,6 +34,13 @@ func TestPullWithContentTrust(t *testing.T) {
|
||||
golden.Assert(t, result.Stdout(), "pull-with-content-trust.golden")
|
||||
}
|
||||
|
||||
func TestPullQuiet(t *testing.T) {
|
||||
result := icmd.RunCommand("docker", "pull", "--quiet", fixtures.AlpineImage)
|
||||
result.Assert(t, icmd.Success)
|
||||
assert.Check(t, is.Equal(result.Stdout(), "registry:5000/alpine:3.6\n"))
|
||||
assert.Check(t, is.Equal(result.Stderr(), ""))
|
||||
}
|
||||
|
||||
func TestPullWithContentTrustUsesCacheWhenNotaryUnavailable(t *testing.T) {
|
||||
skip.If(t, environment.RemoteDaemon())
|
||||
|
||||
|
||||
@@ -2,3 +2,4 @@ Pull (1 of 1): registry:5000/trust-pull:latest@sha256:641b95ddb2ea9dc2af1a0113b6
|
||||
sha256:641b95ddb2ea9dc2af1a0113b6b348ebc20872ba615204fbe12148e98fd6f23d: Pulling from trust-pull
|
||||
Digest: sha256:641b95ddb2ea9dc2af1a0113b6b348ebc20872ba615204fbe12148e98fd6f23d
|
||||
Status: Downloaded newer image for registry:5000/trust-pull@sha256:641b95ddb2ea9dc2af1a0113b6b348ebc20872ba615204fbe12148e98fd6f23d
|
||||
registry:5000/trust-pull:latest
|
||||
|
||||
Reference in New Issue
Block a user