Skip to content

make oras cp skip dangling referrers index deletion error #952

@qweeah

Description

@qweeah

What is the version of your ORAS CLI

1.0.0

What would you like to be added?

oras cp is by-design to stop on the first-met error. if the copy destination is an OCI-1.0-compliant registry with deletion disabled, then oras cp operation might be done half-way without copying all the nodes.

Consider copying the below artifacts via index A to such a registry(OCI 1.0+delete disabled) with concurrency set to 1.

graph TD;
  A--platform b-->B
  A--platform c-->C
  A--platform d-->D
  B--subject-->E
  C--subject-->E
  D--subject-->E
Loading

The copy process will cover all referrers of E, since the concurrency is set to 1, those three referrers, B, C and D will be copied one by one. Let's assume the sequence is B -> C -> D:

  1. When copying B, the referrer index is created with one descriptor pointing to B
  2. When copying C, the referrer index created in step 1) is fetched and append another descriptor of B. The referrer index created in step 1) is dangling and need to be cleaned up
  3. clean up will fail and copy terminated

In this case, D is not covered and the copy process stops.

Why is this needed for ORAS?

Copying progress should not be terminated when such failure encountered, it is not terminal and user can clean up the dangling referrer index after the cp process.

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions