@@ -75,8 +75,8 @@ func runSignImage(ctx context.Context, dockerCLI command.Cli, options signOption
7575 return trust .NotaryError (imgRefAndAuth .Reference ().Name (), err )
7676 }
7777
78- fmt .Fprintf (dockerCLI .Out (), "Created signer: %s \n " , imgRefAndAuth .AuthConfig ().Username )
79- fmt .Fprintf (dockerCLI .Out (), "Finished initializing signed repository for %s \n " , imageName )
78+ _ , _ = fmt .Fprintln (dockerCLI .Out (), "Created signer:" , imgRefAndAuth .AuthConfig ().Username )
79+ _ , _ = fmt .Fprintln (dockerCLI .Out (), "Finished initializing signed repository for" , imageName )
8080 default :
8181 return trust .NotaryError (imgRefAndAuth .RepoInfo ().Name .Name (), err )
8282 }
@@ -91,18 +91,17 @@ func runSignImage(ctx context.Context, dockerCLI command.Cli, options signOption
9191 if err := checkLocalImageExistence (ctx , dockerCLI .Client (), imageName ); err != nil {
9292 return err
9393 }
94- fmt .Fprintf (dockerCLI .Err (), "Signing and pushing trust data for local image %s, may overwrite remote trust data\n " , imageName )
94+ _ , _ = fmt .Fprintf (dockerCLI .Err (), "Signing and pushing trust data for local image %s, may overwrite remote trust data\n " , imageName )
9595
9696 authConfig := command .ResolveAuthConfig (dockerCLI .ConfigFile (), imgRefAndAuth .RepoInfo ().Index )
9797 encodedAuth , err := registrytypes .EncodeAuthConfig (authConfig )
9898 if err != nil {
9999 return err
100100 }
101- options := imagetypes.PushOptions {
101+ return image . TrustedPush ( ctx , dockerCLI , imgRefAndAuth . RepoInfo (), imgRefAndAuth . Reference (), * imgRefAndAuth . AuthConfig (), imagetypes.PushOptions {
102102 RegistryAuth : encodedAuth ,
103103 PrivilegeFunc : requestPrivilege ,
104- }
105- return image .TrustedPush (ctx , dockerCLI , imgRefAndAuth .RepoInfo (), imgRefAndAuth .Reference (), * imgRefAndAuth .AuthConfig (), options )
104+ })
106105 default :
107106 return err
108107 }
@@ -112,7 +111,7 @@ func runSignImage(ctx context.Context, dockerCLI command.Cli, options signOption
112111
113112func signAndPublishToTarget (out io.Writer , imgRefAndAuth trust.ImageRefAndAuth , notaryRepo notaryclient.Repository , target notaryclient.Target ) error {
114113 tag := imgRefAndAuth .Tag ()
115- fmt .Fprintf (out , "Signing and pushing trust metadata for %s \n " , imgRefAndAuth .Name ())
114+ _ , _ = fmt .Fprintln (out , "Signing and pushing trust metadata for" , imgRefAndAuth .Name ())
116115 existingSigInfo , err := getExistingSignatureInfoForReleasedTag (notaryRepo , tag )
117116 if err != nil {
118117 return err
@@ -125,7 +124,7 @@ func signAndPublishToTarget(out io.Writer, imgRefAndAuth trust.ImageRefAndAuth,
125124 if err != nil {
126125 return errors .Wrapf (err , "failed to sign %s:%s" , imgRefAndAuth .RepoInfo ().Name .Name (), tag )
127126 }
128- fmt .Fprintf (out , "Successfully signed %s:%s\n " , imgRefAndAuth .RepoInfo ().Name .Name (), tag )
127+ _ , _ = fmt .Fprintf (out , "Successfully signed %s:%s\n " , imgRefAndAuth .RepoInfo ().Name .Name (), tag )
129128 return nil
130129}
131130
@@ -188,7 +187,7 @@ func getExistingSignatureInfoForReleasedTag(notaryRepo notaryclient.Repository,
188187func prettyPrintExistingSignatureInfo (out io.Writer , existingSigInfo trustTagRow ) {
189188 sort .Strings (existingSigInfo .Signers )
190189 joinedSigners := strings .Join (existingSigInfo .Signers , ", " )
191- fmt .Fprintf (out , "Existing signatures for tag %s digest %s from:\n %s\n " , existingSigInfo .SignedTag , existingSigInfo .Digest , joinedSigners )
190+ _ , _ = fmt .Fprintf (out , "Existing signatures for tag %s digest %s from:\n %s\n " , existingSigInfo .SignedTag , existingSigInfo .Digest , joinedSigners )
192191}
193192
194193func initNotaryRepoWithSigners (notaryRepo notaryclient.Repository , newSigner data.RoleName ) error {
0 commit comments