Skip to content

Improper verbose output of oras discover -o tree #1003

@shizhMSFT

Description

@shizhMSFT

What happened in your environment?

The annotation value one/more/thing is not interpreted correctly.

What did you expect to happen?

one/more/thing should be in one line.

How can we reproduce it?

$ echo hello > hello.txt
$ oras push --oci-layout test:latest hello.txt
Uploading 5891b5b522d5 hello.txt
Uploaded  5891b5b522d5 hello.txt
Pushed [oci-layout] test:latest
Digest: sha256:1ec25e721c68891d389441ae02c0c3a35e59aff394e996dba73f8d2a616f78a3
$ oras attach --oci-layout test:latest --annotation foo=bar --artifact-type test
Uploading empty artifact
Attached to [oci-layout] test@sha256:1ec25e721c68891d389441ae02c0c3a35e59aff394e996dba73f8d2a616f78a3
Digest: sha256:29172865ad23502edeb8745c14624633adeb43c3da5872d56fb0d7c0e4b17e92
$ oras attach --oci-layout test:latest --annotation next=one/more/thing --artifact-type test
Uploading empty artifact
Attached to [oci-layout] test@sha256:1ec25e721c68891d389441ae02c0c3a35e59aff394e996dba73f8d2a616f78a3
Digest: sha256:1fe801f971f6ff238f45e7f7b03aeeb1e36b99146ff3c5eada155f0a1cee1c4b
$ oras discover --oci-layout test:latest -o tree -v
test@sha256:1ec25e721c68891d389441ae02c0c3a35e59aff394e996dba73f8d2a616f78a3
└── test
    ├── sha256:1fe801f971f6ff238f45e7f7b03aeeb1e36b99146ff3c5eada155f0a1cee1c4b
    │   ├── next: one
    │   │   └── more
    │   │       └── thing
    │   └── org.opencontainers.image.created: "2023-07-05T09:26:14Z"
    └── sha256:29172865ad23502edeb8745c14624633adeb43c3da5872d56fb0d7c0e4b17e92
        ├── foo: bar
        └── org.opencontainers.image.created: "2023-07-05T09:25:54Z"

What is the version of your ORAS CLI?

$ oras version
Version:        1.0.0
Go version:     go1.20.2
Git commit:     b58e7b910ca556973d111e9bd734a71baef03db2
Git tree state: clean

What is your OS environment?

Ubuntu 20.04.6 LTS

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions