Skip to content

fix: use VerifyReader to verify read content after oras.Fetch#589

Merged
shizhMSFT merged 2 commits intooras-project:mainfrom
wangxiaoxuan273:verify-reader
Sep 21, 2022
Merged

fix: use VerifyReader to verify read content after oras.Fetch#589
shizhMSFT merged 2 commits intooras-project:mainfrom
wangxiaoxuan273:verify-reader

Conversation

@wangxiaoxuan273
Copy link
Contributor

Resolves #547

Signed-off-by: wangxiaoxuan273 wangxiaoxuan119@gmail.com

Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2022

Codecov Report

Merging #589 (2bde2f3) into main (24abf93) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #589   +/-   ##
=======================================
  Coverage   72.54%   72.54%           
=======================================
  Files          14       14           
  Lines         510      510           
=======================================
  Hits          370      370           
  Misses        112      112           
  Partials       28       28           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines 120 to 123
buf := bytes.NewBuffer(nil)
if _, err := io.Copy(buf, vr); err != nil {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blobs are usually large and cannot be dumped into memory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed according to our offline discussion.

Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shizhMSFT shizhMSFT merged commit d3d5151 into oras-project:main Sep 21, 2022
@wangxiaoxuan273 wangxiaoxuan273 deleted the verify-reader branch September 21, 2022 09:08
TerryHowe pushed a commit to TerryHowe/oras that referenced this pull request Feb 2, 2023
…roject#589)

Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need verify rc against the descriptor after calling oras.Fetch()

3 participants