How to list custom objects for all namespaces? #1589
Unanswered
mikhail-barg
asked this question in
Q&A
Replies: 1 comment
|
Okay, it seems that the problem lies in the k8s api structure itself. So, listing namespace-named objects in a namespace would use the path format Then listing namespace-named objects in all namespaces would use the path format But in case of custom objects the latter format is used for cluster-named custom objects! But it seems this would just work! See for example similar issue in python client: So I'll just have to use But then, there's an issue kubernetes-client/gen#268 that should have this covered soon |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When writing a K8s operator you generally need to look for your custom resources in all namespaces in the cluster. So how to do this?
For standard resources there are
List*ForAllNamespacesAsync()methods in addition toListNamespaced*Async()(e.g.ListServiceForAllNamespacesAsync())But for custom resources there seem to be only
ListNamespacedCustomObjectAsync()and noListCustomObjectForAllNamespacesAsync(). Am I missing something?And yes, I need namespace-scoped custom resources, not cluster-scoped.
All reactions