Skip to content

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

@qweeah

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions