Description
If a (content.ReaderAt).ReadAt returns io.EOF, content.ReadBlob should ignore the error:
|
// ReadBlob retrieves the entire contents of the blob from the provider. |
|
// |
|
// Avoid using this for large blobs, such as layers. |
|
func ReadBlob(ctx context.Context, provider Provider, desc ocispec.Descriptor) ([]byte, error) { |
|
ra, err := provider.ReaderAt(ctx, desc) |
|
if err != nil { |
|
return nil, err |
|
} |
|
defer ra.Close() |
|
|
|
p := make([]byte, ra.Size()) |
|
|
|
_, err = ra.ReadAt(p, 0) |
|
return p, err |
|
} |
// If the n = len(p) bytes returned by ReadAt are at the end of the
// input source, ReadAt may return either err == EOF or err == nil.
// ...
type ReaderAt interface {
ReadAt(p []byte, off int64) (n int, err error)
}
Description
If a
(content.ReaderAt).ReadAtreturnsio.EOF,content.ReadBlobshould ignore the error:containerd/content/helpers.go
Lines 46 to 60 in 1c5b384