Skip to content

Commit

Permalink
Fix proxying HEAD requests for manifest lists in the proxy-cache, loo…
Browse files Browse the repository at this point in the history
…k 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>
  • Loading branch information
cnmcavoy committed Jan 25, 2024
1 parent 522f96b commit 240af51
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server/middleware/repoproxy/proxy.go
Expand Up @@ -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)
}

Check warning on line 310 in src/server/middleware/repoproxy/proxy.go

View check run for this annotation

Codecov / codecov/patch

src/server/middleware/repoproxy/proxy.go#L307-L310

Added lines #L307 - L310 were not covered by tests
for i := 0; i < ensureTagMaxRetry; i++ {
time.Sleep(ensureTagInterval)
bArt := lib.ArtifactInfo{ProjectName: art.ProjectName, Repository: art.Repository, Digest: string(desc.Digest)}
Expand Down

0 comments on commit 240af51

Please sign in to comment.