-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Ignore prompt if stdin not a tty on machine start #27557
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
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: baude The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Luap99
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw I think we can add a test for this.
The tests do expose setStdin() so we could set it to a buffer and then after the command runs make sure the buffer was not read.
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
Honny1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, once @Luap99's comments have been addressed.
When I did this, the buffer is still being read. I could not pinpoint why (in short order). But the code path is correct and it's going through the right conditionals. So we check the output for the usual prompting message to ensure it is not present. |
pkg/machine/shim/host.go
Outdated
| if err != nil { | ||
| return err | ||
| } | ||
| // This might be kind of lame but when using the command, but if you don't |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit of a nit to be cleaned if you have to repush
| // This might be kind of lame but when using the command, but if you don't | |
| // This might be kind of lame but when using the command, if you don't |
|
LGTM once tests and @Luap99 are hip. |
When starting a machine and the user has not explicitly passed -u=true|false AND stdin is a not a tty, we should not prompt to update connections. Fixes: containers#27556 Signed-off-by: Brent Baude <bbaude@redhat.com>
When starting a machine and the user has not explicitly passed -u=true|false AND stdin is a not a tty, we should not prompt to update connections.
Fixes: #27556
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. See CONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?