Expose resource discovery information
We want to know if a resource is namespaced or not, but there's no way in the kubeclient API to get that directly, as all methods using this data are private / do not save namespaced information (e.g. load_entities only keeps kind/name).
/cc @grosser
Indeed :+1: Concrete API proposals and/or PRs welcome.
To take a step back, this is related (but not same) to #388 which was about info from /apis (list of groups) and/or /apis/GROUP (list versions of given group). Here you want /apis/GROUP/VERSION.
- As discussed there, one direction is expose discovery info in kubeclient, which requires deciding on interface.
- Another is #389 (generic support for GET on arbitrary path), meaning you would do your own discovery call. This is necessary in #388 case anyway as they wanted to know available versions before creating client, would be a wasted request in this case, ideally we'd cache the data after doing discovery once.
No need to invent/learn new interface, would use k8s path and response format, which I think for such rare and low-level case is a better balance.
- For this use case, it's a bit awkward to be aware of
/api/VERSIONspecial case vs/apis/GROUP/VERSION, because the client is already configured to use the right path.
- For this use case, it's a bit awkward to be aware of
Looking at your temporary solution in https://github.com/zendesk/samson/pull/3683, you're calling private fetch_entities, which just response format is directly the k8s format, so I guess you could be satisfied with #389? Or do you see saving the redundant request as important?
(BTW, we could also extend #389 to offer a generic version hitting a path at most once, then caching it. And switch discovery to use that.)
=> Bottom line: I'm not against adding a public method for this specifically. I feel #389 has a wider impact and is worth doing anyway. I'm not currently working on either of those, PRs welcome, so your choice :)