From d51a686145a05ef4d15ddcbaab6eb71d9e8a2262 Mon Sep 17 00:00:00 2001 From: stonezdj Date: Fri, 14 Jun 2024 17:19:35 +0800 Subject: [PATCH] Remove the delete local manifest when remote doesn't exist Previous impl it calls c.local.DeleteManifest(remoteRepo, art.Tag), because the remoteRepo is incorrect repository and it always delete nothing, to keep consistency with the previous version and code clarity, remove this go routine Signed-off-by: stonezdj --- src/controller/proxy/controller.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/controller/proxy/controller.go b/src/controller/proxy/controller.go index f177f85e046..38d55397c37 100644 --- a/src/controller/proxy/controller.go +++ b/src/controller/proxy/controller.go @@ -172,9 +172,6 @@ func (c *controller) UseLocalManifest(ctx context.Context, art lib.ArtifactInfo, return false, nil, err } if !exist || desc == nil { - go func() { - c.local.DeleteManifest(remoteRepo, art.Tag) - }() return false, nil, errors.NotFoundError(fmt.Errorf("repo %v, tag %v not found", art.Repository, art.Tag)) } @@ -220,11 +217,6 @@ func (c *controller) ProxyManifest(ctx context.Context, art lib.ArtifactInfo, re ref := getReference(art) man, dig, err := remote.Manifest(remoteRepo, ref) if err != nil { - if errors.IsNotFoundErr(err) { - go func() { - c.local.DeleteManifest(remoteRepo, art.Tag) - }() - } return man, err } ct, _, err := man.Payload()