-
Notifications
You must be signed in to change notification settings - Fork 179
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: add empty check on blobs and manifest annotation #490
Conversation
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.
Still need unit test for ValidateEmpty
added in the pusher struct.
Signed-off-by: JasmineTang <jasminetang@microsoft.com>
Signed-off-by: JasmineTang <jasminetang@microsoft.com>
026c315
to
24987b6
Compare
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/internal/option/pusher.go
Outdated
annotationConfig = "$config" | ||
annotationManifest = "$manifest" |
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.
Let's make them public and update the references in cmd/oras/push.go
.
cmd/oras/internal/option/pusher.go
Outdated
// ValidateEmpty checks whether blobs or manifest annotation are empty. | ||
func (opts *Pusher) ValidateEmpty(args []string) error { | ||
if len(args) == 1 && opts.ManifestAnnotations == "" { | ||
return errors.New("no blob and manifest annotation are provided") | ||
} | ||
return nil | ||
} |
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.
This logic is attach
specific. You might want to take it out of the Pusher
option.
24987b6
to
147d7a0
Compare
Signed-off-by: JasmineTang <jasminetang@microsoft.com>
Signed-off-by: JasmineTang <jasminetang@microsoft.com>
147d7a0
to
9d067fc
Compare
Codecov Report
@@ Coverage Diff @@
## main #490 +/- ##
=======================================
Coverage 71.90% 71.90%
=======================================
Files 9 9
Lines 388 388
=======================================
Hits 279 279
Misses 87 87
Partials 22 22 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: JasmineTang <jasminetang@microsoft.com>
Signed-off-by: JasmineTang <jasminetang@microsoft.com>
Signed-off-by: JasmineTang <jasminetang@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
Signed-off-by: JasmineTang <jasminetang@microsoft.com>
Resolves #467
Signed-off-by: JasmineTang jasminetang@microsoft.com