Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove subject existence check, add media type check #52

Merged
merged 2 commits into from
Jan 5, 2023
Merged

fix: remove subject existence check, add media type check #52

merged 2 commits into from
Jan 5, 2023

Conversation

wangxiaoxuan273
Copy link

@wangxiaoxuan273 wangxiaoxuan273 commented Jan 4, 2023

Resolves #42
Resolves #50
Resolves #49

PR description:

  1. This pr removes subject existence check, as according to the distribution spec, subject existence check is not needed.
  2. This pr removes subject from the References() function. For subject we don't need to check existence, and we need to verify its media type. This is quite different from the validation of layers, blobs and configs (all included in References()), and therefore it's better to move subject out of References(), as all elements of References() are checked in a loop and it's very hard to tell which one is the subject and differentiate its check.

Signed-off-by: wangxiaoxuan273 [email protected]

@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2023

Codecov Report

Merging #52 (7feecaf) into main (884c54b) will decrease coverage by 0.01%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
- Coverage   56.31%   56.29%   -0.02%     
==========================================
  Files         108      108              
  Lines       11211    11210       -1     
==========================================
- Hits         6313     6311       -2     
- Misses       4188     4191       +3     
+ Partials      710      708       -2     
Impacted Files Coverage Δ
manifest/ociartifact/manifest.go 53.19% <ø> (-2.81%) ⬇️
manifest/ocischema/manifest.go 74.19% <ø> (+3.42%) ⬆️
registry/storage/ocimanifesthandler.go 58.18% <0.00%> (-5.82%) ⬇️
registry/storage/ociartifactmanifesthandler.go 63.75% <100.00%> (+4.92%) ⬆️

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

Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants