From c8592150e3515f24f4140f5410684e9168a06058 Mon Sep 17 00:00:00 2001 From: Cameron McAvoy Date: Thu, 18 Jan 2024 16:08:41 -0600 Subject: [PATCH] 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 --- src/server/middleware/repoproxy/proxy.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/middleware/repoproxy/proxy.go b/src/server/middleware/repoproxy/proxy.go index 5fb44a681..b872209b6 100644 --- a/src/server/middleware/repoproxy/proxy.go +++ b/src/server/middleware/repoproxy/proxy.go @@ -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)}