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

oras pull fails when --config is used and there is more than one config in the reference tree #682

Closed
1 task done
qweeah opened this issue Nov 9, 2022 · 0 comments · Fixed by #684
Closed
1 task done
Labels
bug Something isn't working
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Nov 9, 2022

What happened in your environment?

Suppose I have uses an registry that doesn't support OCI artifact, and I have a OCI Image A stored in the registry.

If I use oras attach to created a OCI image B as OCI artifact fallback in the registry, pulling B with oras pull --config config.json $REF_B will fail with Error: config.json: duplicate name.

+-----------------+         +-----------------+
|  oci image B    | subject |  oci image A    |
|    (attached)   +--------->    (pushed)     |
+-----------------+         +-----------------+

What did you expect to happen?

oras pull --config config.json $REF_B should only pull only the config of root node, in this case config of image B.

How can we reproduce it?

  1. start a oss distribution
docker run -dp 5000:5000 registry
  1. generate an image and push
echo image > image
echo config > image.config.json
oras push localhost:5000/test:image --config image.config.json image
  1. attach an artifact and obtain DIGEST from the result
echo sbom > sbom
oras attach localhost:5000/test:image sbom --artifact-type sbom.type
  1. pull the attached artifact
oras pull localhost:5000/test@${DIGEST} --config config.json

This step will fail with Error: config.json: duplicate name.

What is the version of your ORAS CLI?

Version: 0.16.0
Go version: go1.19.2
Git commit: d606fed
Git tree state: clean

What is your OS environment?

Ubuntu 20.04

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.
@qweeah qweeah added the bug Something isn't working label Nov 9, 2022
@qweeah qweeah changed the title oras pull fallback artifact fails when sujbect is not nil and --config is used oras pull fails when --config is used and there is more than one config in the reference tree Nov 9, 2022
@shizhMSFT shizhMSFT added this to the v0.16.1 milestone Nov 9, 2022
shizhMSFT pushed a commit that referenced this issue Nov 14, 2022
@shizhMSFT shizhMSFT moved this to Done in ORAS-Planning Nov 14, 2022
@FeynmanZhou FeynmanZhou modified the milestones: v0.16.1, v1.0.0-rc.1 Jan 3, 2023
TerryHowe pushed a commit to TerryHowe/oras that referenced this issue Feb 2, 2023
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
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants