-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
Do not guess resource endpoints #467
Comments
My proposal:
|
Yeah, we know this is bad. It's #284. Was hoping we'd get a fix in k8s-openapi, but no one has jumped on the issue there yet. I think your proposal is reasonable. Now that We could potentially do one better by tackling cluster/namespaced scoping as part of the trait (see #199) as well (although one for a separate PR i think). |
As for naming; |
whatisinternet/Inflector#73 fixes the Do we have any irregular plurals to handle? I feel like we can use a much simpler function to handle basic pluralization instead. |
No longer guessing unless we have to from 0.52.0 |
Currently
Resource
(which is the only entity that is actually working with Kubernetes URLs) only known resource kind (such as "Pod"). However, URLs contain resource name instead (e.g. "pods" or "statefulsets").Resource
usesinflector
crate to pluralize the kind and assumes that is it valid resource name. Although it works for most of resources, this means that is impossible to useClient
with resources that do not follow this scheme (no matter are you using typedApi<k8s_openapi::Foo>
or untypedApi<DynamicObject>
). Just several examples of such resources:discovery.k8s.io
:EndpointSlice
is served onendpointslices
, but inflector guessesendpointsliceice
.metrics.k8s.io
:NodeMetrics
is served onnodes
, andPodMetrics
is served onpods
. Impossible to guess.It seems that in typed case we can't get rid of inflector until
k8s-openapi
provides us with this information, but at least dynamic API should work without guessing URLs.The text was updated successfully, but these errors were encountered: