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

cmd/observe: fix stdin reading from file redirection #815

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

rolinh
Copy link
Member

@rolinh rolinh commented Nov 14, 2022

The hubble observe command could only read from stdin when being piped to, e.g. cat sample.json | hubble observe but not via file redirect such as hubble observe < sample.json. This commit makes the latter possible.

Fix: #809

@rolinh rolinh added the release-note/bug This PR fixes an issue in a previous release of Hubble. label Nov 14, 2022
@rolinh rolinh requested a review from a team as a code owner November 14, 2022 17:10
@rolinh rolinh requested review from michi-covalent and removed request for a team November 14, 2022 17:10
Copy link
Collaborator

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat

@gandro

This comment was marked as resolved.

@gandro
Copy link
Member

gandro commented Nov 14, 2022

Nevermind my above comment. isTTY is for the output, but we're checking the input.

The `hubble observe` command could only read from stdin when being piped
to, e.g. `cat sample.json | hubble observe` but not via file redirect
such as `hubble observe < sample.json`. This commit makes the latter
possible.

Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
@rolinh rolinh force-pushed the pr/rolinh/fix-stdin-redirection branch from 1a8e686 to 3d510aa Compare November 15, 2022 09:43
@rolinh
Copy link
Member Author

rolinh commented Nov 15, 2022

@gandro I've updated the patch. I think checking that stdin is not character device is sufficient.

@michi-covalent michi-covalent merged commit 33cdbd5 into master Nov 15, 2022
@michi-covalent michi-covalent deleted the pr/rolinh/fix-stdin-redirection branch November 15, 2022 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/bug This PR fixes an issue in a previous release of Hubble.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hubble observe does not work with stdin redirection
3 participants