Skip to content
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 watch_node support #342

Closed
grosser opened this issue Jun 29, 2018 · 5 comments
Closed

add watch_node support #342

grosser opened this issue Jun 29, 2018 · 5 comments
Labels
doc Need to add/improve documentation enhancement help wanted watches About watching k8s objects

Comments

@grosser
Copy link
Contributor

grosser commented Jun 29, 2018

this works kubeclient.watch_entities 'nodes/foo' so just needs an alias ... sounds good ?
@cben

@cben
Copy link
Collaborator

cben commented Jul 1, 2018

watch_nodes seems to work. AFAICT define_entity_methods only creates watch_plural methods — do you mean we should add watch_singular methods?

@grosser
Copy link
Contributor Author

grosser commented Jul 1, 2018

would be nice for completeness, at first I though it's not possible until I tried on kubectl and then made the workaround

watch_nodes with name does not work:

irb(main):015:0> w = kubeclient.watch_nodes 'fooo'
=> #<Kubeclient::Common::WatchStream:0x000055e5d6ad6580 @uri=#<URI::HTTPS https://10.100.0.1/api/v1/watch/nodes?resourceVersion=fooo>,

@cben cben added the doc Need to add/improve documentation label Dec 15, 2019
@cben
Copy link
Collaborator

cben commented Dec 15, 2019

Hmm, it seems the "intended" way to do it now is client.watch_nodes(name: 'foo').
It's not documented in README though!
And it's quite surprising for one method to do singular/plural double duty...

See #312 for overview of our current APIs wrt. name and namespace 🤕

We have #332 sketching a better replacement for *_entity, *_entities methods, which are not currently documented as public.
My current proposal there uses a similar pattern where .get and .watch do double duty, depending on presence of name and namespace — I don't know if that's good or bad, feedback wanted 🙏


EDIT: I'm NOT opposed to adding watch_singular methods like watch_node for clarity. But I'd love to decide something on #332 first and align to that.

Anyway, current name: param should be documented in README.

@cben
Copy link
Collaborator

cben commented Dec 15, 2019

I meant I'm not opposed :)

@cben cben added the watches About watching k8s objects label Dec 16, 2019
@cben
Copy link
Collaborator

cben commented Mar 11, 2020

Adding hopefully clearer docs in #436, please review.

@grosser grosser closed this as completed Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Need to add/improve documentation enhancement help wanted watches About watching k8s objects
Projects
None yet
Development

No branches or pull requests

2 participants