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

NaN shown in the progress bar with zero-length blob #1175

Closed
1 task done
qweeah opened this issue Nov 6, 2023 · 0 comments · Fixed by #1178
Closed
1 task done

NaN shown in the progress bar with zero-length blob #1175

qweeah opened this issue Nov 6, 2023 · 0 comments · Fixed by #1178
Assignees
Labels
bug Something isn't working triage New issues or PRs to be acknowledged by maintainers
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Nov 6, 2023

What happened in your environment?

Suppose I have below artifact which refers a zero-length blob:

$ oras manifest fetch --pretty localhost:5000/test:config
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "artifactType": "my.test/example",
  "config": {
    "mediaType": "bar/test",
    "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "size": 0
  },
  "layers": [
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar",
      "digest": "sha256:86c1503eb091280c98d8519c344f41ffcb03545662f0122c76d8f0e6b84e4a33",
      "size": 7,
      "annotations": {
        "org.opencontainers.image.title": "foo"
      }
    }
  ],
  "annotations": {
    "org.opencontainers.image.created": "2023-11-03T01:47:25Z"
  }
}

Copying the artifact will show

$ oras cp localhost:5000/test:config --to-oci-layout foo
✓ Copied  foo                                                                                   7/7  B 100.00%     0s
  └─ sha256:86c1503eb091280c98d8519c344f41ffcb03545662f0122c76d8f0e6b84e4a33
✓ Copied  bar/test                                                                            NaN/0       NaN%    2ms
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
✓ Copied  application/vnd.oci.image.manifest.v1+json                                        522/522  B 100.00%     0s
  └─ sha256:34a441c3a3183228689768215fffe158c78ec7a94067cc43e54aa4961eacdc1d
Copied [registry] localhost:5000/test:config => [oci-layout] foo
Digest: sha256:34a441c3a3183228689768215fffe158c78ec7a94067cc43e54aa4961eacdc1d

What did you expect to happen?

Should show

$ oras cp localhost:5000/test:config --to-oci-layout foo
✓ Copied  foo                                                                                   7/7  B 100.00%     0s
  └─ sha256:86c1503eb091280c98d8519c344f41ffcb03545662f0122c76d8f0e6b84e4a33
✓ Copied  bar/test                                                                            0/0       100%    2ms
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
✓ Copied  application/vnd.oci.image.manifest.v1+json                                        522/522  B 100.00%     0s
  └─ sha256:34a441c3a3183228689768215fffe158c78ec7a94067cc43e54aa4961eacdc1d
Copied [registry] localhost:5000/test:config => [oci-layout] foo
Digest: sha256:34a441c3a3183228689768215fffe158c78ec7a94067cc43e54aa4961eacdc1d

How can we reproduce it?

Bake a manifest with 0-length blob and oras copy it

What is the version of your ORAS CLI?

v1.1.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 Nov 6, 2023
@qweeah qweeah added this to the v1.2.0 milestone Nov 6, 2023
@qweeah qweeah self-assigned this Nov 6, 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 triage New issues or PRs to be acknowledged by maintainers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant