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

--format and --pretty should not be used at the same time for oras manifest fetch #1356

Closed
1 task
qweeah opened this issue Apr 18, 2024 · 1 comment · Fixed by #1359
Closed
1 task

--format and --pretty should not be used at the same time for oras manifest fetch #1356

qweeah opened this issue Apr 18, 2024 · 1 comment · Fixed by #1359
Assignees
Labels
bug Something isn't working
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Apr 18, 2024

What happened in your environment?

I can use --format and --pretty at the same time for oras manifest fetch

> oras manifest fetch localhost:5000/demo:eol --pretty --format json
{
  "ref": "localhost:5000/demo@sha256:8536ab80a4bfef21647eb36f0f17bac607c995149cc818c3a5b4dd8153cb7006",
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "digest": "sha256:8536ab80a4bfef21647eb36f0f17bac607c995149cc818c3a5b4dd8153cb7006",
  "size": 535,
  "content": {
    "annotations": {
      "org.opencontainers.image.created": "2024-04-15T12:31:43Z"
    },
    "artifactType": "application/vnd.unknown.artifact.v1",
    "config": {
      "data": "e30=",
      "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
      "mediaType": "application/vnd.oci.empty.v1+json",
      "size": 2
    },
    "layers": [
      {
        "data": "e30=",
        "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
        "mediaType": "application/vnd.oci.empty.v1+json",
        "size": 2
      }
    ],
    "mediaType": "application/vnd.oci.image.manifest.v1+json",
    "schemaVersion": 2
  }
}

The --pretty is actually ignore since it only effects raw content output. The output of --format json is already designed to be prettified

What did you expect to happen?

Return error when --format and --pretty are used at the same time for command oras manifest fetch

How can we reproduce it?

Fetch a manifest with --format and --pretty.

What is the version of your ORAS CLI?

Version: 1.2.0-beta.1+unreleased
Go version: go1.22.1
Git commit: 2edebad

What is your OS environment?

Ubuntu 20.05

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 Apr 18, 2024
@qweeah qweeah added this to the v1.2.0-rc.1 milestone Apr 18, 2024
@qweeah
Copy link
Contributor Author

qweeah commented Apr 18, 2024

@wangxiaoxuan273 Can you help take a look at this issue since you are already working on refactoring the utilities function of flag conflict detection?

@qweeah qweeah removed the triage New issues or PRs to be acknowledged by maintainers label Apr 19, 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
Development

Successfully merging a pull request may close this issue.

2 participants