kapp reads confirmation prompt from stdin not tty #1003
Labels
bug
This issue describes a defect or unexpected behavior
carvel accepted
This issue should be considered for future work and that the triage process has been completed
What steps did you take:
simplified example (real case uses a json input not
jq --null-input
):What happened:
What did you expect:
kapp
to prompt for confirmation and read input from the tty since--yes
was not passed.Anything else you would like to add:
The bug here is that
kapp
tries to read interactive confirmation from stdin. That's rarely correct; the user mayfor example. But within the
while
loop, stdin points to the output of thejq
command.kapp
wasn't given-f -
or anything so it isn't expected to read from stdin.It should do what
sudo
and other tools do - detect an interactive tty and read directly from the tty, rather than stdin.Workaround
To work around the bug, dup the stdin fd before you enter the loop or pass the pipe, e.g.
or
Environment:
kapp version 0.63.2
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
The text was updated successfully, but these errors were encountered: