-
Notifications
You must be signed in to change notification settings - Fork 210
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
Use exec.StreamWithContext to replace ExecInPodWithTTY and CtrlCReader #1276
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tklauser
added
the
dont-merge/preview-only
Only for preview or testing, don't merge it.
label
Dec 7, 2022
This was referenced Dec 9, 2022
tklauser
force-pushed
the
pr/tklauser/cilium-k8s-bump
branch
from
December 9, 2022 14:22
7fe4a61
to
ed2cbe2
Compare
tklauser
changed the title
WIP: use exec.StreamWithContext to replace ExecInPodWithTTY and CtrlCReader
Use exec.StreamWithContext to replace ExecInPodWithTTY and CtrlCReader
Dec 9, 2022
tklauser
removed
the
dont-merge/preview-only
Only for preview or testing, don't merge it.
label
Dec 9, 2022
rolinh
approved these changes
Dec 9, 2022
@@ -7,7 +7,6 @@ replace ( | |||
github.com/miekg/dns => github.com/cilium/dns v1.1.4-0.20190417235132-8e25ec9a0ff3 | |||
github.com/optiopay/kafka => github.com/cilium/kafka v0.0.0-20180809090225-01ce283b732b | |||
go.universe.tf/metallb => github.com/cilium/metallb v0.1.1-0.20220829170633-5d7dfb1129f7 | |||
k8s.io/client-go => github.com/cilium/client-go v0.0.0-20220819140146-d9df1ee1f047 |
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.
🚀 Please, keep removing these replace directives ❤️
squeed
approved these changes
Dec 12, 2022
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.
Brilliant!
maintainer-s-little-helper
bot
added
the
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
label
Dec 12, 2022
This allows to drop the replace directive as well, see cilium/cilium#22547 for details. Signed-off-by: Tobias Klauser <[email protected]>
exec.Stream is deprecated. Use exec.StreamWithContext to avoid possible resource leaks. Signed-off-by: Tobias Klauser <[email protected]>
Setting TTY/stdin in PodExecOptions seems to lead to all kinds issues, which are hard to debug (see e.g. [1]). Also, stdout and stderr are combined which might make it hard to parse command output. [1] https://discuss.kubernetes.io/t/go-client-exec-ing-a-shel-command-in-pod/5354 The only reason the code was using TTY/stdin is to cancel commands by sending Ctrl-C on context cancellation. Now that we're using exec.StreamWithContext, there is no need for that anymore. Signed-off-by: Tobias Klauser <[email protected]>
tklauser
force-pushed
the
pr/tklauser/cilium-k8s-bump
branch
from
December 12, 2022 10:07
ed2cbe2
to
226fea2
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See commits for details