-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: optimize filters for oras.ExtendedCopy
#3
Conversation
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
b88a48f
to
c14a471
Compare
oras.ExtendedCopy
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 need to test this PR with real servers, or we have a good mock.
Also, I am wondering if the optimization works with other Targets like memory and OCI Targets.
extendedcopy.go
Outdated
fp := opts.FindPredecessors | ||
opts.FindPredecessors = func(ctx context.Context, src content.ReadOnlyGraphStorage, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { | ||
var predecessors []ocispec.Descriptor | ||
var err error | ||
if fp == nil { | ||
if rf, ok := src.(registry.ReferrerFinder); ok { |
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.
Just a note and not related to this PR: With OCI Artifact support, a registry.Repository
should always be a registry.ReferrerFinder
. We will have registry.Referrers(ctx context.Context, repo Repository) ([]string, error
later.
In the current implementation, the annotations and the artifact type can be indexed only if they are populated in the descriptor on pushing. |
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>
According to Open Container Initiative Distribution Specification, the
Referrers
API must include theartifactType
andannotations
of the referrers in the returned descriptor list. (Predecessors
also supports this)Related to oras-project#310
Signed-off-by: Lixia (Sylvia) Lei lixlei@microsoft.com