From 26430ecbdae182928b5efbafcf29677a746d1215 Mon Sep 17 00:00:00 2001 From: "Lixia (Sylvia) Lei" Date: Fri, 17 Jan 2025 19:50:08 +0800 Subject: [PATCH] fix: scope action only has pull when get service token in executing cmd org push (#1608) Signed-off-by: hopegi <690383065@qq.com> Co-authored-by: hopegi <690383065@qq.com> --- cmd/oras/root/push.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)