Skip to content

Commit e0b47cc

Browse files
committed
cli/command/image: imagePullPrivileged: remove intermediate variables
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 372bb56 commit e0b47cc

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

cli/command/image/trust.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,20 +262,17 @@ func getTrustedPullTargets(cli command.Cli, imgRefAndAuth trust.ImageRefAndAuth)
262262

263263
// imagePullPrivileged pulls the image and displays it to the output
264264
func imagePullPrivileged(ctx context.Context, cli command.Cli, imgRefAndAuth trust.ImageRefAndAuth, opts PullOptions) error {
265-
ref := reference.FamiliarString(imgRefAndAuth.Reference())
266-
267265
encodedAuth, err := registrytypes.EncodeAuthConfig(*imgRefAndAuth.AuthConfig())
268266
if err != nil {
269267
return err
270268
}
271269
requestPrivilege := command.RegistryAuthenticationPrivilegedFunc(cli, imgRefAndAuth.RepoInfo().Index, "pull")
272-
options := types.ImagePullOptions{
270+
responseBody, err := cli.Client().ImagePull(ctx, reference.FamiliarString(imgRefAndAuth.Reference()), types.ImagePullOptions{
273271
RegistryAuth: encodedAuth,
274272
PrivilegeFunc: requestPrivilege,
275273
All: opts.all,
276274
Platform: opts.platform,
277-
}
278-
responseBody, err := cli.Client().ImagePull(ctx, ref, options)
275+
})
279276
if err != nil {
280277
return err
281278
}

0 commit comments

Comments
 (0)