Skip to content

oras cp -r fails if index has a child manifest as subject #1129

@shizhMSFT

Description

@shizhMSFT

What happened in your environment?

oras cp -r fails if an index points to the same manifest as a child manifest and a subject.

$ oras cp -r -v ghcr.io/sudo-bmitch/oci-sandbox:loop --to-oci-layout sandbox:loop
Error: sha256:ab497c435e6242b8d9ce0a7ec9e74f4c7550e7b1890b64c6d31e6f9ddc8ee885: application/vnd.oci.image.index.v1+json: not found

What did you expect to happen?

$ oras cp -r -v ghcr.io/sudo-bmitch/oci-sandbox:loop --to-oci-layout sandbox
Copied [registry] ghcr.io/sudo-bmitch/oci-sandbox:loop => [oci-layout] sandbox
Digest: sha256:ab497c435e6242b8d9ce0a7ec9e74f4c7550e7b1890b64c6d31e6f9ddc8ee885

How can we reproduce it?

Run oras cp -r -v ghcr.io/sudo-bmitch/oci-sandbox:loop --to-oci-layout sandbox:loop

What is the version of your ORAS CLI?

Version:        1.1.0+unreleased
Go version:     go1.21.1
Git commit:     8cf946fb9170242eece7e79967462e8274cbace1
Git tree state: clean

What is your OS environment?

ubuntu 22.04

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.

Credit

Credit to @sudo-bmitch for finding the bug (Slack conversation).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions