-
Notifications
You must be signed in to change notification settings - Fork 519
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
chore: update js and typescript examples #1082
chore: update js and typescript examples #1082
Conversation
@@ -1,12 +1,13 @@ | |||
const k8s = require('@kubernetes/client-node'); | |||
// in a real program use require('@kubernetes/client-node') | |||
const k8s = require('../dist/index'); |
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.
I did this to match the previous PR.
@@ -64,28 +64,28 @@ Code will be on the `master` branch. | |||
- [x] cache-example | |||
- [x] example | |||
- [x] follow-logs | |||
- [ ] in-cluster-create-job-from-cronjob | |||
- [ ] in-cluster-create-job-from-cronjob // done but unable to test with media type problems |
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.
Let me know if there is a better or more preferred way to denote this.
// find the particular deployment | ||
const res = await k8sApi.readNamespacedDeployment(name, namespace); | ||
let deployment = res.body; | ||
async function scale(deploymentNamespace, deploymentName, replicas) { |
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 stick tonamespace
and name
here instead of deploymentNamespace
and deploymentName
?
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.
The reason I did this was because as an example, I think it is easier to read the named parameters as { name: variableName, namespace: anotherName }
rather than using object shorthand property names like { name, namespace }
. In general I prefer what you are saying, but as an example I find this more easier to digest.
console.log('create', name); | ||
}; | ||
|
||
const deletePod = async (name, namespace) => { | ||
await k8sApi.deleteNamespacedPod(name, namespace); | ||
const deletePod = async (podName: string, podNamespace: 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.
name
, namespace
?
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.
Same reason above.
1c432a7
to
655e45f
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, clintonmedbery, mstruebing 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 |
This is part two of updating examples to node-fetch. A lot of these examples do not work do to this issue (#893) but I have updated the syntax to match what we need with fetch. Other examples do work. Let me know if you would like me to separate these out.
Right now I just put a note in the
FETCH_MIGRATION
file. If you have another idea to best handle this then let me know and I will update.