-
Notifications
You must be signed in to change notification settings - Fork 98
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
feat: Support platform selection on Copy #244
Conversation
NIT: function comments should alway ends with a dot. https://tip.golang.org/doc/comment#Funcs |
6cbedba
to
29bf7e4
Compare
47a33ce
to
bfbc405
Compare
6fa3900
to
020ee6a
Compare
3557557
to
6aabee8
Compare
Codecov Report
@@ Coverage Diff @@
## main #244 +/- ##
==========================================
+ Coverage 70.50% 70.68% +0.18%
==========================================
Files 35 36 +1
Lines 3109 3217 +108
==========================================
+ Hits 2192 2274 +82
- Misses 682 700 +18
- Partials 235 243 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
c0c03fc
to
8be0e77
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
aa3013c
to
e2af366
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
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 with suggestions on documentation
Signed-off-by: REDMOND\zoeyli <zoeyli@microsoft.com>
…g error instead of ErrNotFound] Signed-off-by: Zoey Li <zoeyli@microsoft.com>
…add test] Signed-off-by: Zoey Li <zoeyli@microsoft.com>
Signed-off-by: Zoey Li <zoeyli@microsoft.com>
Signed-off-by: Zoey Li <zoeyli@microsoft.com>
Signed-off-by: Zoey Li <zoeyli@microsoft.com>
Signed-off-by: Zoey Li <zoeyli@microsoft.com>
Signed-off-by: Zoey Li <zoeyli@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
internal/platform/platform.go
Outdated
return false | ||
} | ||
|
||
set := make(map[string]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.
Looks like you want to use it as a set. using struct{} instead of bool can save memory.
Support platform selection on Copy by adding
AddPlatformFilter
func that configure theMapRoot
option for clients.Platform property ref: OCI Image Index Specification
The given platform matches the target platform if all of the below conditions are met:
Note: Variant, OSVersion, OSFeatures and Features are optional fields, will skip the comparison if the target platform does not provide specfic value.
If multiple manifests match a client or runtime's requirements, the first matching entry will be returned.
Resolves #210
Signed-off-by: REDMOND\zoeyli zoeyli@microsoft.com