0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

fix(s3): fix check in dedupe logic (#2700)

cache.HasBlob() looks in both buckets: duplicates and original blobs
Because we want to check if the blob is in original bucket let's use
cache.GetBlob() because it's looking only in original bucket.

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>
This commit is contained in:
peusebiu 2024-10-03 22:27:58 +03:00 committed by GitHub
parent e6624a29a5
commit 513f2a0dc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1930,7 +1930,7 @@ func (is *ImageStore) dedupeBlobs(ctx context.Context, digest godigest.Digest, d
}
// cache original blob
if ok := is.cache.HasBlob(digest, originalBlob); !ok {
if _, err := is.cache.GetBlob(digest); err != nil {
if err := is.cache.PutBlob(digest, originalBlob); err != nil {
return err
}