You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what I read so far on kubernetes/kubernetes#13885, the /log endpoints only expects binary.k8s.io as protocol. Without it (but still sending the *.channel.k8s.io ones), a 403 Forbidden status code is returned.
I'll try to submit a PR for this in the upcoming days, suggestions are welcome.
@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.
It's been a while but try something along these lines @chadbr:
const myStream = new stream.Writable({
write(chunk, encoding, callback) {
console.log(chunk.toString().trimRight())
// or do something else more useful to you
callback()
}
})
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 spawn - I get an object back with the process streams:
// return this object when stdio option is undefined or not specifiedinterfaceChildProcessWithoutNullStreamsextendsChildProcess{stdin: Writable;stdout: Readable;stderr: Readable;
I would have assumed the log function would return something like `stdout: Readable;'? What am I missing?
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).
Activity
[-]Add a client for the pod read-log `/log` endpoint[/-][+]Add a client for the pod read-log endpoint[/+]Fixes kubernetes-client#82 Add a client for the pod read-log endpoint
dbolkensteyn commentedon Aug 15, 2018
PR opened, let's discuss there
Fixes kubernetes-client#82 Add a client for the pod read-log endpoint
Fixes kubernetes-client#82 Add a client for the pod read-log endpoint
Fixes kubernetes-client#82 Add a client for the pod read-log endpoint
Fixes kubernetes-client#82 Add a client for the pod read-log endpoint
Fixes kubernetes-client#82 Add a client for the pod read-log endpoint
Fixes kubernetes-client#82 Add a client for the pod read-log endpoint
Merge pull request #83 from dbolkensteyn/read-log
chadbr commentedon Nov 5, 2019
@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
dbolkensteyn commentedon Nov 5, 2019
It's been a while but try something along these lines @chadbr:
and then pass
myStreamas the argument.chadbr commentedon Nov 5, 2019
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
spawn- I get an object back with the process streams:I would have assumed the log function would return something like `stdout: Readable;'? What am I missing?
chadbr commentedon Nov 5, 2019
As a side note -- I think I might have found a small bug?
applyToRequestis async / returns a promise, and it's not awaited / resolved? I'm not sure if it matters...javascript/src/log.ts
Lines 78 to 79 in 9d5757e
Sorry for the noise...
dbolkensteyn commentedon Nov 6, 2019
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).