diff --git a/cmd/oras/root/push.go b/cmd/oras/root/push.go index 1b7396aa2..c6b8b5d90 100644 --- a/cmd/oras/root/push.go +++ b/cmd/oras/root/push.go @@ -255,7 +255,7 @@ func runPush(cmd *cobra.Command, opts *pushOptions) error { copyWithScopeHint := func(root ocispec.Descriptor) error { // add both pull and push scope hints for dst repository // to save potential push-scope token requests during copy - ctx = registryutil.WithScopeHint(ctx, dst, auth.ActionPull, auth.ActionPush) + ctx = registryutil.WithScopeHint(ctx, originalDst, auth.ActionPull, auth.ActionPush) if tag := opts.Reference; tag == "" { err = oras.CopyGraph(ctx, union, dst, root, copyOptions.CopyGraphOptions)