From f29607202d5a72ee5325171bf7fc6698ccb4e45f Mon Sep 17 00:00:00 2001 From: "Lixia (Sylvia) Lei" Date: Fri, 20 Oct 2023 16:51:43 +0800 Subject: [PATCH] perf: reduce auth request count for manifest delete (#623) Backporting 0f1dc30a0fd713f3bafcf3bd52693b2e8a8a6fa5 to the release branch. This change does the same thing as the original commit (#618) did but using the old `registryutil.WithScopeHint` instead of `auth.AppendRepositoryScope`, which is introduced by #604 and is not available in `v2.3.x`. Signed-off-by: Lixia (Sylvia) Lei --- registry/remote/repository.go | 1 + 1 file changed, 1 insertion(+) diff --git a/registry/remote/repository.go b/registry/remote/repository.go index fc4f6bf6..769f614d 100644 --- a/registry/remote/repository.go +++ b/registry/remote/repository.go @@ -1121,6 +1121,7 @@ func (s *manifestStore) deleteWithIndexing(ctx context.Context, target ocispec.D if err := limitSize(target, s.repo.MaxMetadataBytes); err != nil { return err } + ctx = registryutil.WithScopeHint(ctx, s.repo.Reference, auth.ActionPull, auth.ActionDelete) manifestJSON, err := content.FetchAll(ctx, s, target) if err != nil { return err