-
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: only fallback to OCI image when current media type is OCI artifact #673
Conversation
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
cmd/oras/push.go
Outdated
@@ -276,22 +276,25 @@ func pushArtifact(dst *remote.Repository, pack packFunc, packOpts *oras.PackOpti | |||
return root, nil | |||
} | |||
|
|||
func isArtifactUnsupported(err error) bool { | |||
func noFallbackToOciImage(root ocispec.Descriptor, err error) bool { |
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.
Making isArtifactUnsupported
to noFallbackToOciImage
might improve the readability of the invokers but make the readability of the implementation itself worse and easier to have bugs in it.
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.
Do you still have this concern after the refactoring?
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Codecov Report
@@ Coverage Diff @@
## main #673 +/- ##
=======================================
Coverage 72.12% 72.12%
=======================================
Files 14 14
Lines 513 513
=======================================
Hits 370 370
Misses 114 114
Partials 29 29 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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
Signed-off-by: Billy Zha <jinzha1@microsoft.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
…ct (oras-project#673) Resolves oras-project#672 Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Resolves #672
Signed-off-by: Billy Zha jinzha1@microsoft.com