Open ringerc opened 3 months ago
@ringerc Thanks for creating the issue. In general, folks just pass -y
when they want to pipe the output from some other tool to kapp or when they want to deploy multiple apps.
I agree that kapp should be reading the confirmation from tty, so I am marking it as accepted. I am not sure when the maintainers will be able to pick this up, however we would be happy to review if you would like to contribute a PR.
Also, you might find kapp app-group deploy
interesting if you are trying to deploy multiple apps based on folder structure.
Thanks for the tip
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.