Skip to content

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

@qweeah

Description

@qweeah

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)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions