-
Notifications
You must be signed in to change notification settings - Fork 544
Add a client for the pod read-log endpoint #82
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
Comments
/log
endpoint
PR opened, let's discuss there |
Fixes #82 Add a client for the pod read-log endpoint
@dbolkensteyn Hey Dinesh -- Can you point me to an example of how to use the Log.log(..) method? I have not been able to figure out how to get something out the of the stream: Writable parameter. Thanks, Chad |
It's been a while but try something along these lines @chadbr:
and then pass |
Thanks @dbolkensteyn -- I'm failing to grasp why we would pass a writable stream instead of getting a readable stream from the log function? I'm assuming the function is there to read log streams? Sorry for the dumb question... For example, when I call // return this object when stdio option is undefined or not specified
interface ChildProcessWithoutNullStreams extends ChildProcess {
stdin: Writable;
stdout: Readable;
stderr: Readable; I would have assumed the log function would return something like `stdout: Readable;'? What am I missing? |
As a side note -- I think I might have found a small bug?
this.config.applyToRequest(requestOptions); Lines 78 to 79 in 9d5757e
Sorry for the noise... |
I don't have a good answer to either of your points as my knowledge of TypeScript is limited. Feel free to further investigate and open new issues (and/or PRs). |
Command-line:
kubectl log <pod-name>
Documentation: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#read-log-pod-v1-core
From what I read so far on kubernetes/kubernetes#13885, the
/log
endpoints only expectsbinary.k8s.io
as protocol. Without it (but still sending the*.channel.k8s.io
ones), a403 Forbidden
status code is returned.I'll try to submit a PR for this in the upcoming days, suggestions are welcome.
Right now I'm trying to fit this into
WebSocketHandler
, but there is already a binary handler that expects the first byte of the message to be the channel number, which is not the case for the/log
endpoint. See https://github.com/kubernetes-client/javascript/blob/master/node-client/src/web-socket-handler.ts#L89-L94The text was updated successfully, but these errors were encountered: