-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
exec cannot read stdout/stderr data after stdin reaches EOF #1689
Comments
Hey there. Thanks for this! I think this makes sense to do. Would you like to submit a PR? |
I'll try an make a PR for this. It looks like the fix is more involved than just removing the break. |
esw-amzn
added a commit
to esw-amzn/kube
that referenced
this issue
Feb 11, 2025
Signed-off-by: Eric Webster <[email protected]>
esw-amzn
added a commit
to esw-amzn/kube
that referenced
this issue
Feb 11, 2025
Signed-off-by: Eric Webster <[email protected]>
esw-amzn
added a commit
to esw-amzn/kube
that referenced
this issue
Feb 19, 2025
Signed-off-by: Eric Webster <[email protected]>
esw-amzn
added a commit
to esw-amzn/kube
that referenced
this issue
Feb 19, 2025
Signed-off-by: Eric Webster <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current and expected behavior
I'm trying to implement a tool for my application that has similar behavior to
kubectl exec
. I've encountered an issue when piping data to stdin. As soon as stdin is closed the Rust client closes both stdin and stdout streams and there is no way to get any remaining stdout data.The equivalent
kubectl
command would be something like this.In this case "hello world" is properly echoed back. When I try the equivalent of this with my Rust tool using kube-client I never get the echoed response.
Possible solution
It appears the issue is with the
break
here. https://github.com/kube-rs/kube/blob/main/kube-client/src/api/remote_command.rs#L342This break causes the entire message loop to shut down as soon as the end of stdin is reached. So it is not possible to get any remaining stdout/stderr data back after stdin is finished. It seems removing the
break
would fix the issue.Looking at the Go client implementation, it appears that the Go implementation continues to read from stdout/stderr even after stdin is closed. https://github.com/kubernetes/client-go/blob/master/tools/remotecommand/v2.go#L183-L188
Additional context
No response
Environment
Configuration and features
Affected crates
kube-client
Would you like to work on fixing this bug?
maybe
The text was updated successfully, but these errors were encountered: