@@ -12,6 +12,7 @@ import (
1212 "github.com/docker/cli/cli/streams"
1313 "github.com/docker/cli/cli/trust"
1414 "github.com/docker/cli/internal/jsonstream"
15+ "github.com/docker/cli/internal/registry"
1516 "github.com/moby/moby/api/types/image"
1617 registrytypes "github.com/moby/moby/api/types/registry"
1718 "github.com/opencontainers/go-digest"
@@ -42,12 +43,15 @@ func newNotaryClient(cli command.Streams, imgRefAndAuth trust.ImageRefAndAuth) (
4243}
4344
4445// pushTrustedReference pushes a canonical reference to the trust server.
45- func pushTrustedReference (ctx context.Context , ioStreams command.Streams , indexInfo * registrytypes.IndexInfo , ref reference.Named , authConfig registrytypes.AuthConfig , in io.Reader ) error {
46+ func pushTrustedReference (ctx context.Context , dockerCLI command.Cli , ref reference.Named , responseBody io.Reader ) error {
47+ // Resolve the Repository name from fqn to RepositoryInfo
48+ indexInfo := registry .NewIndexInfo (ref )
4649 repoInfo := & trust.RepositoryInfo {
4750 Name : reference .TrimNamed (ref ),
4851 Index : indexInfo ,
4952 }
50- return trust .PushTrustedReference (ctx , ioStreams , repoInfo , ref , authConfig , in , command .UserAgent ())
53+ authConfig := command .ResolveAuthConfig (dockerCLI .ConfigFile (), indexInfo )
54+ return trust .PushTrustedReference (ctx , dockerCLI , repoInfo , ref , authConfig , responseBody , command .UserAgent ())
5155}
5256
5357// trustedPull handles content trust pulling of an image
0 commit comments