@@ -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/pkg/authconfig"
1617 registrytypes "github.com/moby/moby/api/types/registry"
1718 "github.com/moby/moby/client"
@@ -43,12 +44,15 @@ func newNotaryClient(cli command.Streams, imgRefAndAuth trust.ImageRefAndAuth) (
4344}
4445
4546// pushTrustedReference pushes a canonical reference to the trust server.
46- func pushTrustedReference (ctx context.Context , ioStreams command.Streams , indexInfo * registrytypes.IndexInfo , ref reference.Named , authConfig registrytypes.AuthConfig , in io.Reader ) error {
47+ func pushTrustedReference (ctx context.Context , dockerCLI command.Cli , ref reference.Named , responseBody io.Reader ) error {
48+ // Resolve the Repository name from fqn to RepositoryInfo
49+ indexInfo := registry .NewIndexInfo (ref )
4750 repoInfo := & trust.RepositoryInfo {
4851 Name : reference .TrimNamed (ref ),
4952 Index : indexInfo ,
5053 }
51- return trust .PushTrustedReference (ctx , ioStreams , repoInfo , ref , authConfig , in , command .UserAgent ())
54+ authConfig := command .ResolveAuthConfig (dockerCLI .ConfigFile (), indexInfo )
55+ return trust .PushTrustedReference (ctx , dockerCLI , repoInfo , ref , authConfig , responseBody , command .UserAgent ())
5256}
5357
5458// trustedPull handles content trust pulling of an image
0 commit comments