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

oras blob fetch failed to output to stdout in TTY mode #1268

Closed
1 task
qweeah opened this issue Feb 5, 2024 · 2 comments · Fixed by #1286 or #1381
Closed
1 task

oras blob fetch failed to output to stdout in TTY mode #1268

qweeah opened this issue Feb 5, 2024 · 2 comments · Fixed by #1286 or #1381
Assignees
Labels
bug Something isn't working
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Feb 5, 2024

What happened in your environment?

I tried to fetch a blob with oras blob fetch and output the content into stdout in terminal mode. The blob content is not printed to stdout as expected

oras blob fetch ghcr.io/oras-project/oras@sha256:488a49baab43328b45444fc9c13861da4408f279ba5247569bbe06a732265fdc --output -
✓ Downloaded  application/octet-stream                                                                  167/167  B 100.00%     0s
  └─ sha256:488a49baab43328b45444fc9c13861da4408f279ba5247569bbe06a732265fdc

With --no-tty, the content can be printed

oras blob fetch ghcr.io/oras-project/oras@sha256:488a49baab43328b45444fc9c13861da4408f279ba5247569bbe06a732265fdc --output - --no-tty
{"architecture":"unknown","os":"unknown","config":{},"rootfs":{"type":"layers","diff_ids":["sha256:31e4a5298aed7d277e1784bc57ff297a450e25eb59d5b7ac89f6bb229ac1a18a"]}}%

What did you expect to happen?

The blob content should be printed to stdout

How can we reproduce it?

Run below command

oras blob fetch ghcr.io/oras-project/oras@sha256:488a49baab43328b45444fc9c13861da4408f279ba5247569bbe06a732265fdc --output -

What is the version of your ORAS CLI?

v1.2.0-beta.1

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 Feb 5, 2024
@qweeah qweeah added this to the v1.2.0 milestone Feb 5, 2024
@shizhMSFT shizhMSFT removed the triage New issues or PRs to be acknowledged by maintainers label Mar 11, 2024
@FeynmanZhou
Copy link
Member

To fix this issue, it would be reasonable to make --output - emit the content of "oras blob fetch" to stdout. That's being said, the flag --output - implies --no-tty in oras blob fetch. A sample experience is as follows:

$ oras blob fetch ghcr.io/oras-project/oras@sha256:488a49baab43328b45444fc9c13861da4408f279ba5247569bbe06a732265fdc --output -
{"architecture":"unknown","os":"unknown","config":{},"rootfs":{"type":"layers","diff_ids":["sha256:31e4a5298aed7d277e1784bc57ff297a450e25eb59d5b7ac89f6bb229ac1a18a"]}}%

@qweeah
Copy link
Contributor Author

qweeah commented Mar 15, 2024

We should also allow user to avoid TTY resetting via explicitly put --no-tty=false.

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
4 participants