diff --git a/cli/command/image/pull.go b/cli/command/image/pull.go index 0cf3df609d..9d77e04696 100644 --- a/cli/command/image/pull.go +++ b/cli/command/image/pull.go @@ -54,6 +54,10 @@ func runPull(cli command.Cli, opts pullOptions) error { if !opts.all && reference.IsNameOnly(distributionRef) { distributionRef = reference.TagNameOnly(distributionRef) + imgRefAndAuth, err = trust.GetImageReferencesAndAuth(ctx, AuthResolver(cli), distributionRef.String()) + if err != nil { + return err + } if tagged, ok := distributionRef.(reference.Tagged); ok { fmt.Fprintf(cli.Out(), "Using default tag: %s\n", tagged.Tag()) } diff --git a/cli/command/image/trust.go b/cli/command/image/trust.go index f2847e954b..85f816e219 100644 --- a/cli/command/image/trust.go +++ b/cli/command/image/trust.go @@ -200,7 +200,11 @@ func trustedPull(ctx context.Context, cli command.Cli, imgRefAndAuth trust.Image if err != nil { return err } - if err := imagePullPrivileged(ctx, cli, imgRefAndAuth, false); err != nil { + updatedImgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, AuthResolver(cli), trustedRef.String()) + if err != nil { + return err + } + if err := imagePullPrivileged(ctx, cli, updatedImgRefAndAuth, false); err != nil { return err }