From 0f1dc30a0fd713f3bafcf3bd52693b2e8a8a6fa5 Mon Sep 17 00:00:00 2001 From: "Lixia (Sylvia) Lei" Date: Wed, 18 Oct 2023 16:04:45 +0800 Subject: [PATCH] perf: reduce auth request count for manifest delete (#618) Add `pull` and `delete` scope hints before attempting client-side indexing on manifest delete. Resolve: #594 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 5373492b..b91054fc 100644 --- a/registry/remote/repository.go +++ b/registry/remote/repository.go @@ -1120,6 +1120,7 @@ func (s *manifestStore) deleteWithIndexing(ctx context.Context, target ocispec.D if err := limitSize(target, s.repo.MaxMetadataBytes); err != nil { return err } + ctx = auth.AppendRepositoryScope(ctx, s.repo.Reference, auth.ActionPull, auth.ActionDelete) manifestJSON, err := content.FetchAll(ctx, s, target) if err != nil { return err