Closed zfrhv closed 3 months ago
Welcome @zfrhv!
It looks like this is your first PR to kubernetes-client/javascript 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes-client/javascript has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
This looks pretty good, added some small comments and it looks like you need to rebase to pick up some dependabot changes that got merged.
I was going to create genericApi
class for get/apply/delete/create.. functions but i stumbled into object.ts, it looks like its the generic api that I was looking for.
although looking at example usage it seems a bit complicated to use.
still this class is exactly what I was about to make.
should I just add more example and try to use watch
with object.ts
instead of creating genericApi
?
@zfrhv Thanks! I had forgotten about that. Yes, I think adding watch
to that and also maybe simplifying it if you want to? That would be great!
I tried to combine object.ts
with watch.ts
but it seems too complex for me.
I can create seperate watch function inside object.ts
but thats just copy paste from watch.ts
and it will look messy.
So I tried to call the watch function from KubernetesObjectApi
inside object.ts
but cant figure out how to pass the Kubernetes config, it seems like its locally stored as a token and im not sure how to use it.
maybe @schrodit can help to create watch
inside object.ts
About the extra examples I added: i didnt tested them but i think they should work. All my k8s clusters are airgapped and testing something from the internet is pain. I wish someone else could test it for me <3
I tried to combine
object.ts
withwatch.ts
but it seems too complex for me.I can create seperate watch function inside
object.ts
but thats just copy paste fromwatch.ts
and it will look messy.So I tried to call the watch function from
KubernetesObjectApi
insideobject.ts
but cant figure out how to pass the Kubernetes config, it seems like its locally stored as a token and im not sure how to use it.maybe @schrodit can help to create
watch
insideobject.ts
About the extra examples I added: i didnt tested them but i think they should work.
All my k8s clusters are airgapped and testing something from the internet is pain.
I wish someone else could test it for me <3
I think I already did that in an internal wrapper.
Let me take a look and I open a separate PR.
I fixed the examples.
Im not good enought to understand how to add watch function inside object.js
so I will leave it to the pros
@zfrhv started the CI process and it seems like you have linting errors.
You can see the results either in the github action logs or locally by running npm run lint
You can also run npm run format
to fix at least some of them.
/lgtm /approve
Thanks for these example, I think they are very useful for new users. 🚀
As mentioned above, if you ever find the time, it would be great to port these to the release-1.x
branch as well.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: mstruebing, zfrhv
The full list of commands accepted by this bot can be found here.
The pull request process is described here
solves #1595
let me know if it looks good. then I will add it to docs and maybe also use genericApi at get/apply/delete...