-
Notifications
You must be signed in to change notification settings - Fork 539
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
Added FollowLogs class #214
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.
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. 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
Needs 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use newer import syntax everywhere.
const stream = new LineStream(); | ||
stream.on('data', (data) => { | ||
callback(data.toString()); | ||
}); |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. In 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
readNamespacedPodLog
inapi.ts
and theWatch
class inwatch.ts
.