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

list all customObjects fro all namespaces #941

Closed
huhu-sky opened this issue May 1, 2020 · 8 comments
Closed

list all customObjects fro all namespaces #941

huhu-sky opened this issue May 1, 2020 · 8 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@huhu-sky
Copy link

huhu-sky commented May 1, 2020

How can i list all customObjects fro all namespaces if the customObject's scope is namespace.
I just see the api customObjectsApi.listNamespacedCustomObject ;
For service, we can use 'coreV1Api.listServiceForAllNamespaces'
Thanks to reply.

@brendandburns
Copy link
Contributor

Unfortunately the definition for that isn't in the openapi spec that is used to generate the client.

It needs to be added here:
https://github.com/kubernetes-client/gen/blob/master/openapi/custom_objects_spec.json

And then have the client regenerated.

@huhu-sky
Copy link
Author

huhu-sky commented May 3, 2020

Thanks to reply!

image

How to add it to the json file?
there is already the key "/apis/{group}/{version}/{plural}", so how can i add a method named "listCustomObjectForAllNamespaces" ?
does the method "get" support an array input.

@huhu-sky
Copy link
Author

huhu-sky commented May 3, 2020

by the way,
is there an auto generator tool to generate java model from crd?

@brendandburns
Copy link
Contributor

brendandburns commented May 4, 2020

The full kubernetes swagger is here:

https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json

If you search for forAllNamespaces you'll see some examples.

There is a very alpha level tool for generating Java from CRDs documented here:

https://github.com/kubernetes-client/java/blob/master/docs/generate-model-from-third-party-resources.md

We're working on making it more official/complete.

See the issue here:
#921

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 2, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 1, 2020
@huhu-sky huhu-sky closed this as completed Sep 4, 2020
@davidxia
Copy link
Contributor

Using listClusterCustomObject() worked for me even though my custom resource is namespace scoped.

@davidxia
Copy link
Contributor

@brendandburns I have the same question as @huhu-sky if you have any ideas.

How to add it to the json file?
there is already the key "/apis/{group}/{version}/{plural}", so how can i add a method named "listCustomObjectForAllNamespaces" ?
does the method "get" support an array input.

I created this issue and restated the problem here kubernetes-client/gen#268 (comment). Basically, custom_objects_api already has a get for the non-namespaced API path with the name of list_cluster_custom_object. So it doesn't seem to allow generating another method named list_custom_object_for_all_namespaces for the same method and path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants