-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add Pod methods #1
Conversation
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.
Great work! Some suggestions added below :)
@simskij comments are handled, Pod Kill and Pod Get added. Review again please |
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.
Good job!
README.md
Outdated
|
||
# xk6-kubernetes | ||
A k6 extension for using of K8s in testing. Built for [k6](https://github.com/loadimpact/k6) using [xk6](https://github.com/k6io/xk6). |
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.
A k6 extension for using of K8s in testing. Built for [k6](https://github.com/loadimpact/k6) using [xk6](https://github.com/k6io/xk6). | |
A k6 extension for interacting with Kubernetes clusters while testing. Built for [k6](https://github.com/loadimpact/k6) using [xk6](https://github.com/k6io/xk6). |
pods.go
Outdated
) | ||
|
||
type PodsNamespace struct { | ||
Client *kubernetes.Clientset |
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.
This should probably be private, right?
examples/kill-pod.js
Outdated
let podsList = getPodNames(nameSpace, kubernetes) | ||
const podName = Object.keys(podsList)[0] | ||
kubernetes.pods.kill(podName, nameSpace) | ||
// TODO: for some reason we can't feel terminating status |
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.
This is determined by checking pod.object_meta.deletion_timestamp
. If it's not null, it has received a termination instruction. Maybe kubernetes.pods.isTerminating(pod)
could return a bool based on this condition, as state changes won't be pushed to the js object you already have.
@simskij comments handled review again, please. The rest functionality will be handled in upcoming PRs. |
getPods
method