@@ -10,12 +10,12 @@ import (
10
10
11
11
"github.com/distribution/reference"
12
12
"github.com/docker/cli/cli/command"
13
+ "github.com/docker/cli/cli/internal/jsonmessage"
13
14
"github.com/docker/cli/cli/streams"
14
15
"github.com/docker/cli/cli/trust"
15
16
"github.com/docker/docker/api/types"
16
17
"github.com/docker/docker/api/types/image"
17
18
registrytypes "github.com/docker/docker/api/types/registry"
18
- "github.com/docker/docker/pkg/jsonmessage"
19
19
"github.com/docker/docker/registry"
20
20
"github.com/opencontainers/go-digest"
21
21
"github.com/pkg/errors"
@@ -39,13 +39,13 @@ func TrustedPush(ctx context.Context, cli command.Cli, repoInfo *registry.Reposi
39
39
40
40
defer responseBody .Close ()
41
41
42
- return PushTrustedReference (cli , repoInfo , ref , authConfig , responseBody )
42
+ return PushTrustedReference (ctx , cli , repoInfo , ref , authConfig , responseBody )
43
43
}
44
44
45
45
// PushTrustedReference pushes a canonical reference to the trust server.
46
46
//
47
47
//nolint:gocyclo
48
- func PushTrustedReference (ioStreams command.Streams , repoInfo * registry.RepositoryInfo , ref reference.Named , authConfig registrytypes.AuthConfig , in io.Reader ) error {
48
+ func PushTrustedReference (ctx context. Context , ioStreams command.Streams , repoInfo * registry.RepositoryInfo , ref reference.Named , authConfig registrytypes.AuthConfig , in io.Reader ) error {
49
49
// If it is a trusted push we would like to find the target entry which match the
50
50
// tag provided in the function and then do an AddTarget later.
51
51
target := & client.Target {}
@@ -84,14 +84,14 @@ func PushTrustedReference(ioStreams command.Streams, repoInfo *registry.Reposito
84
84
default :
85
85
// We want trust signatures to always take an explicit tag,
86
86
// otherwise it will act as an untrusted push.
87
- if err := jsonmessage .DisplayJSONMessagesToStream ( in , ioStreams .Out (), nil ); err != nil {
87
+ if err := jsonmessage .DisplayStream ( ctx , in , ioStreams .Out (), nil ); err != nil {
88
88
return err
89
89
}
90
90
fmt .Fprintln (ioStreams .Err (), "No tag specified, skipping trust metadata push" )
91
91
return nil
92
92
}
93
93
94
- if err := jsonmessage .DisplayJSONMessagesToStream ( in , ioStreams .Out (), handleTarget ); err != nil {
94
+ if err := jsonmessage .DisplayStream ( ctx , in , ioStreams .Out (), handleTarget ); err != nil {
95
95
return err
96
96
}
97
97
@@ -283,7 +283,7 @@ func imagePullPrivileged(ctx context.Context, cli command.Cli, imgRefAndAuth tru
283
283
if opts .quiet {
284
284
out = streams .NewOut (io .Discard )
285
285
}
286
- return jsonmessage .DisplayJSONMessagesToStream ( responseBody , out , nil )
286
+ return jsonmessage .DisplayStream ( ctx , responseBody , out , nil )
287
287
}
288
288
289
289
// TrustedReference returns the canonical trusted reference for an image reference
0 commit comments