tryReusingExactBlob is a subset of TryReusingBlob which _only_ looks for exactly the specified blob in the current repository, with no cross-repo reuse or mounting; cache may be updated, it is not read. The caller must ensure info.Digest is set.
(ctx context.Context, info types.BlobInfo, cache blobinfocache.BlobInfoCache2)
| 309 | // blob in the current repository, with no cross-repo reuse or mounting; cache may be updated, it is not read. |
| 310 | // The caller must ensure info.Digest is set. |
| 311 | func (d *dockerImageDestination) tryReusingExactBlob(ctx context.Context, info types.BlobInfo, cache blobinfocache.BlobInfoCache2) (bool, private.ReusedBlob, error) { |
| 312 | exists, size, err := d.blobExists(ctx, d.ref.ref, info.Digest, nil) |
| 313 | if err != nil { |
| 314 | return false, private.ReusedBlob{}, err |
| 315 | } |
| 316 | if exists { |
| 317 | cache.RecordKnownLocation(d.ref.Transport(), bicTransportScope(d.ref), info.Digest, newBICLocationReference(d.ref)) |
| 318 | return true, private.ReusedBlob{Digest: info.Digest, Size: size}, nil |
| 319 | } |
| 320 | return false, private.ReusedBlob{}, nil |
| 321 | } |
| 322 | |
| 323 | func optionalCompressionName(algo *compressiontypes.Algorithm) string { |
| 324 | if algo != nil { |
no test coverage detected