Skip to content

Commit

Permalink
cmd/observe: fix stdin reading from file redirection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rolinh authored and michi-covalent committed Nov 15, 2022
1 parent 88e8f82 commit 33cdbd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/observe/flows.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ more.`,
if err != nil {
return err
}
if fi.Mode()&os.ModeNamedPipe != 0 {
if fi.Mode()&os.ModeCharDevice == 0 {
// read flows from stdin
client = newIOReaderObserver(os.Stdin)
logger.Logger.Debug("Reading flows from stdin")
Expand Down

0 comments on commit 33cdbd5

Please sign in to comment.