Skip to content
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

[bug] onCopySkipped called unexpectly on root node when using oras.Copy #552

Closed
qweeah opened this issue Jul 14, 2023 · 0 comments · Fixed by #609
Closed

[bug] onCopySkipped called unexpectly on root node when using oras.Copy #552

qweeah opened this issue Jul 14, 2023 · 0 comments · Fixed by #609
Labels
bug Something isn't working
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Jul 14, 2023

See below snippet, onCopySkipped (396-400) should not be invoked when destination target is a reference pusher, since line 406 does fetch the root node from proxy and push it to the destination, which is copying.

oras-go/copy.go

Lines 396 to 410 in f0a9c59

if onCopySkipped != nil {
if err := onCopySkipped(ctx, desc); err != nil {
return err
}
}
if !content.Equal(desc, root) {
return nil
}
// enforce tagging when root is skipped
if refPusher, ok := dst.(registry.ReferencePusher); ok {
return copyCachedNodeWithReference(ctx, proxy, refPusher, desc, dstRef)
}
return dst.Tag(ctx, root, dstRef)
}

@qweeah qweeah changed the title [bug] onCopySkipped called on root node when using oras.Copy even when root exists in the destination target [bug] onCopySkipped called on root node when using oras.Copy Jul 14, 2023
@qweeah qweeah changed the title [bug] onCopySkipped called on root node when using oras.Copy [bug] onCopySkipped called unexpectly on root node when using oras.Copy Jul 14, 2023
@Wwwsylvia Wwwsylvia added the bug Something isn't working label Jul 17, 2023
@Wwwsylvia Wwwsylvia added this to the v2.4.0 milestone Aug 18, 2023
Wwwsylvia added a commit that referenced this issue Sep 26, 2023
Fix: #552
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Wwwsylvia added a commit to Wwwsylvia/oras-go that referenced this issue Oct 19, 2023
Fix: oras-project#552
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
shizhMSFT pushed a commit that referenced this issue Oct 20, 2023
Fix: #552
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

2 participants