-
Notifications
You must be signed in to change notification settings - Fork 180
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: check if configPath is empty before writing to Annotations #509
Conversation
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cmd/oras/pull.go
Outdated
@@ -120,6 +120,9 @@ func runPull(opts pullOptions) error { | |||
// Note: For a manifest, the 0th indexed element is always a | |||
// manifest config. | |||
if s.MediaType == configMediaType || (configMediaType == "" && i == 0 && isManifestMediaType(desc.MediaType)) { | |||
if configPath == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if a config is named but configPath
is empty? In that case, we should download it, shouldn’t we?
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## main #509 +/- ##
=======================================
Coverage 72.68% 72.68%
=======================================
Files 9 9
Lines 388 388
=======================================
Hits 282 282
Misses 85 85
Partials 21 21 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Below command should download
Manifest content of
|
…-project#509) Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
This pr adds empty string check before writing configPath to Annotations, so that if a config only specifies the type but not name, oras cli should not fetch the content of this config.
Part of issue #415
Signed-off-by: wangxiaoxuan273 wangxiaoxuan119@gmail.com