-
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
refactor: optimize extended copy filters #335
Conversation
This PR is migrated from oci-playground#3. |
Codecov Report
@@ Coverage Diff @@
## main #335 +/- ##
==========================================
- Coverage 72.18% 72.13% -0.06%
==========================================
Files 38 38
Lines 3635 3678 +43
==========================================
+ Hits 2624 2653 +29
- Misses 752 764 +12
- Partials 259 261 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
extendedcopy.go
Outdated
filter := func(desc ocispec.Descriptor) bool { | ||
return regex.MatchString(desc.ArtifactType) | ||
} |
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.
Same as above in FilterAnnotation
.
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.
BTW, we can have something like
func (opts *ExtendedCopyGraphOptions) MatchArtifactType(artifactType string) {
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.
How about
func (opts *ExtendedCopyGraphOptions) SelectArtifactType(artifactType string) {
?
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.
We can add this into rc.5
.
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.
select: v. carefully choose as being the best or most suitable.
match: v. be equal to (something) in quality or strength.
Basically, to select, you need a list of items first :D
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 create an issue in rc.5
to track 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.
LGTM
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
5f39bee
to
f8ff44e
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
According to Open Container Initiative Distribution Specification, the
Referrers API
must include the artifact type and annotations of the referrers in the returned descriptor list.However, the
Predecessors
function implemented by file, OCI, and memory store is not guaranteed to include the artifact type and annotations in the returned descriptors.This PR is migrated from oci-playground#3.
Resolves #310
Signed-off-by: Lixia (Sylvia) Lei lixlei@microsoft.com