mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-27 13:02:59 +02:00
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:
parent
69fc957d7e
commit
c8592150e3
@ -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
|
// 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
|
// Ensure tag after head request, make sure tags in proxy cache keep update
|
||||||
bCtx := orm.Context()
|
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++ {
|
for i := 0; i < ensureTagMaxRetry; i++ {
|
||||||
time.Sleep(ensureTagInterval)
|
time.Sleep(ensureTagInterval)
|
||||||
bArt := lib.ArtifactInfo{ProjectName: art.ProjectName, Repository: art.Repository, Digest: string(desc.Digest)}
|
bArt := lib.ArtifactInfo{ProjectName: art.ProjectName, Repository: art.Repository, Digest: string(desc.Digest)}
|
||||||
|
Loading…
Reference in New Issue
Block a user