fix(storage): do not open/download blobs when validating manifests (#1566)

when pushing manifests, zot will validate blobs (layers + config blob) are
present in repo, currently it opens(in case of filesystem storage) or download(
in case of cloud storage) each blob.

fixed that by adding a new method ImageStore.CheckBlobPresence() on storage
to check blobs presence without checking the cache like ImageStore.CheckBlob() method does.

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
peusebiu
2023-07-06 20:33:36 +03:00
committed by GitHub
parent f3aa855405
commit 5494a1b8d6
9 changed files with 136 additions and 18 deletions
+2 -2
View File
@@ -138,8 +138,8 @@ func validateOCIManifest(imgStore storageTypes.ImageStore, repo, reference strin
continue
}
_, err := imgStore.GetBlobContent(repo, layer.Digest)
if err != nil {
ok, _, err := imgStore.StatBlob(repo, layer.Digest)
if err != nil || !ok {
return layer.Digest, zerr.ErrBlobNotFound
}
}