Skip to content

Commit

Permalink
fix(s3): fix check in dedupe logic (#2700)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
eusebiu-constantin-petu-dbk authored Oct 3, 2024
1 parent e6624a2 commit 513f2a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/storage/imagestore/imagestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 513f2a0

Please sign in to comment.