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

reference in the formatted output of oras pull is invalid #1494

Closed
1 task
qweeah opened this issue Sep 3, 2024 · 0 comments · Fixed by #1496 or #1577
Closed
1 task

reference in the formatted output of oras pull is invalid #1494

qweeah opened this issue Sep 3, 2024 · 0 comments · Fixed by #1496 or #1577
Assignees
Labels
bug Something isn't working
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Sep 3, 2024

What happened in your environment?

I tried pull an artifact from remote registry but the metadata output of oras pull is invalid

> oras push localhost:5000/test/more:v1,v2,v3,v4 a b c
✓ Uploaded  c                                                                                   0/0  B 100.00%   37ms
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
✓ Exists    application/vnd.oci.empty.v1+json                                                   2/2  B 100.00%     0s
  └─ sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
✓ Uploaded  application/vnd.oci.image.manifest.v1+json                                      979/979  B 100.00%     0s
  └─ sha256:b50821edb443436f82a70b918af5577a116c9d0012a1641af3394cc2b0366fb0
✓ Skipped   a                                                                                   0/0  B 100.00%     0s
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
✓ Skipped   b                                                                                   0/0  B 100.00%     0s
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Pushed [registry] localhost:5000/test/more:v1
Tagged v4
Tagged v2
Tagged v3
ArtifactType: application/vnd.unknown.artifact.v1
Digest: sha256:b50821edb443436f82a70b918af5577a116c9d0012a1641af3394cc2b0366fb0

> oras pull localhost:5000/test/more:v1 --format json
✓ Pulled      c                                                                                 0/0  B 100.00%  699µs
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
✓ Pulled      application/vnd.oci.image.manifest.v1+json                                    979/979  B 100.00%    2ms
  └─ sha256:b50821edb443436f82a70b918af5577a116c9d0012a1641af3394cc2b0366fb0
✓ Restored    a                                                                                 0/0  B 100.00%     0s
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
✓ Restored    b                                                                                 0/0  B 100.00%     0s
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
{
  "reference": "@sha256:b50821edb443436f82a70b918af5577a116c9d0012a1641af3394cc2b0366fb0",
  "files": [
    {
      "path": "/home/azureuser/test/pull/a",
      "reference": "localhost:5000/test/more@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
      "mediaType": "application/vnd.oci.image.layer.v1.tar",
      "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
      "size": 0,
      "annotations": {
        "org.opencontainers.image.title": "a"
      }
    },
    {
      "path": "/home/azureuser/test/pull/b",
      "reference": "localhost:5000/test/more@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
      "mediaType": "application/vnd.oci.image.layer.v1.tar",
      "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
      "size": 0,
      "annotations": {
        "org.opencontainers.image.title": "b"
      }
    },
    {
      "path": "/home/azureuser/test/pull/c",
      "reference": "localhost:5000/test/more@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
      "mediaType": "application/vnd.oci.image.layer.v1.tar",
      "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
      "size": 0,
      "annotations": {
        "org.opencontainers.image.title": "c"
      }
    }
  ]
}

What did you expect to happen?

The reference field in the format output of oras pull should be localhost:5000/test/more@sha256:b50821edb443436f82a70b918af5577a116c9d0012a1641af3394cc2b0366fb0

How can we reproduce it?

Try pull an artifact and format the output to json

What is the version of your ORAS CLI?

v1.2.0

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 bug Something isn't working triage New issues or PRs to be acknowledged by maintainers labels Sep 3, 2024
@qweeah qweeah added this to the v1.3.0 milestone Sep 3, 2024
@qweeah qweeah removed the triage New issues or PRs to be acknowledged by maintainers label Sep 3, 2024
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
None yet
2 participants