Fix proxying HEAD requests for manifest lists in the proxy-cache, look up the manifest in case it was a manifest list request, as there will be no subsequent GET request

Signed-off-by: Cameron McAvoy <cmcavoy@indeed.com>
This commit is contained in:
Cameron McAvoy 2024-01-18 16:08:41 -06:00
parent 69fc957d7e
commit c8592150e3
1 changed files with 4 additions and 0 deletions

View File

@ -304,6 +304,10 @@ func proxyManifestHead(ctx context.Context, w http.ResponseWriter, ctl proxy.Con
// Then GET the image by digest, in order to associate the tag with the digest
// Ensure tag after head request, make sure tags in proxy cache keep update
bCtx := orm.Context()
_, err := ctl.ProxyManifest(ctx, art, remote)
if err != nil {
log.Debugf("Failed to ensure proxy manifest %+v , error %v", art, err)
}
for i := 0; i < ensureTagMaxRetry; i++ {
time.Sleep(ensureTagInterval)
bArt := lib.ArtifactInfo{ProjectName: art.ProjectName, Repository: art.Repository, Digest: string(desc.Digest)}