Repository navigation
Added FollowLogs class - #214
borremosch wants to merge 1 commit into
Conversation
|
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: borremosch If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
I have signed the CLA |
| @@ -0,0 +1,116 @@ | |||
| import { LineStream } from 'byline'; | |||
| import request = require('request'); | |||
There was a problem hiding this comment.
use newer import syntax everywhere.
| const stream = new LineStream(); | ||
| stream.on('data', (data) => { | ||
| callback(data.toString()); | ||
| }); |
There was a problem hiding this comment.
Probably should have stream.on('error', ...)
|
Thanks, this generally looks good, a few small comments. |
| * @param {FollowLogsOptions} options | ||
| */ | ||
| public followPodLog( | ||
| name: string, |
There was a problem hiding this comment.
Can we please make this consistent with the other api methods? namespace, podName, containerName
See
https://github.com/kubernetes-client/javascript/blob/master/src/exec.ts#L34
https://github.com/kubernetes-client/javascript/blob/master/src/attach.ts#L20
This only makes use of pod
https://github.com/kubernetes-client/javascript/blob/master/src/portforward.ts#L25
@brendandburns I would actually be in favour of requiring container name since logs operator on container similar to exec we can always default it to the cluster/config default if undefined.
There was a problem hiding this comment.
that's fine with me too. consistent api makes sense. thanks for higlighting that.
|
@borremosch I'm going to merge #83 instead of this PR, since it was earlier (and subsumes this functionality) please have a look at that and see if it addresses your needs. Thanks! (and apologies) |
|
/close Closing this in favor of #83 which was merged and lack of response. |
|
@drubin: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Because I was unable to follow the logs of a specific pod as described in #110, I created this helper class based on a combination of
readNamespacedPodLoginapi.tsand theWatchclass inwatch.ts.