Skip to content

Commit

Permalink
Merge pull request #162 from hustcat/oci-fix
Browse files Browse the repository at this point in the history
OCI source: return error if open blob failed
  • Loading branch information
runcom authored Nov 14, 2016
2 parents e9fed84 + 1c5762f commit f782f3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oci/layout/oci_src.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (s *ociImageSource) GetTargetManifest(digest string) ([]byte, string, error
return m, manifest.GuessMIMEType(m), nil
}

// GetBlob returns a stream for the specified blob, and the blobs size (or -1 if unknown).
// GetBlob returns a stream for the specified blob, and the blob's size.
func (s *ociImageSource) GetBlob(digest string) (io.ReadCloser, int64, error) {
path, err := s.ref.blobPath(digest)
if err != nil {
Expand All @@ -79,11 +79,11 @@ func (s *ociImageSource) GetBlob(digest string) (io.ReadCloser, int64, error) {

r, err := os.Open(path)
if err != nil {
return nil, 0, nil
return nil, 0, err
}
fi, err := r.Stat()
if err != nil {
return nil, 0, nil
return nil, 0, err
}
return r, fi.Size(), nil
}
Expand Down

0 comments on commit f782f3c

Please sign in to comment.