How to list custom objects for all namespaces? #1589
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 |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions