-
Notifications
You must be signed in to change notification settings - Fork 166
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
.get_endpoints.kind == "Endpoint" vs .get_endpoint(...).kind == "Endpoints" #307
Labels
Comments
Besides kind, neither the collection nor the individual items expose |
cben
added a commit
to cben/kubeclient
that referenced
this issue
Nov 22, 2018
cben
added a commit
to cben/kubeclient
that referenced
this issue
Nov 22, 2018
Also fixes ManageIQ#307 - get_endpoints.kind now plural as in kubernetes.
1 task
cben
added a commit
to cben/kubeclient
that referenced
this issue
Nov 23, 2018
cben
added a commit
to cben/kubeclient
that referenced
this issue
Nov 23, 2018
Also fixes ManageIQ#307 - get_endpoints.kind now plural as in kubernetes.
This was referenced Nov 23, 2018
cben
added a commit
to cben/kubeclient
that referenced
this issue
Nov 23, 2018
ManageIQ#367 Also fixes ManageIQ#307 - get_security_context_constraints.kind, get_endpoints.kind are now plural as in kubernetes. Also fixes ManageIQ#367 - create_security_context_constraint now works.
cben
added a commit
to cben/kubeclient
that referenced
this issue
Nov 23, 2018
cben
added a commit
to cben/kubeclient
that referenced
this issue
Nov 26, 2018
cben
added a commit
to cben/kubeclient
that referenced
this issue
Nov 26, 2018
ManageIQ#367 Also fixes ManageIQ#307 - get_security_context_constraints.kind, get_endpoints.kind are now plural as in kubernetes. Also fixes ManageIQ#367 - create_security_context_constraint now works.
cben
added a commit
to cben/kubeclient
that referenced
this issue
Nov 26, 2018
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When getting a single entity, we return .kind as-is:
For collections, k8s does not return individual .kind in each item, only a global list kind.
We do some magic to convert that to a singular .kind, without the
List
.Somewhat confusingly, we do this on the EntityList pseudo-array, no .kind on individual item:
The immediate bug here is "Endpoints" vs "Endpoint" and "SecurityContextConstraints" vs "SecurityContextConstraint" mismatch, because the single is already plural in k8s (see kubernetes/kubernetes#8115 (comment), kubernetes/kubernetes#18622, #81, #261 for background).
I'm not 100% sure which way to fix it, but I think the reason we "fixed" the double plural is merely we needed distinct
get_foo
/get_foos
method names — which is a kubeclient concern that should not leak into.kind
, it should always be a valid k8s API kind.The wider question I want to discuss (not necessarily here) is what's the purpose of this magic?
Towards that, I'd like us to provide the non-List .kind (and apiVersion?) inside every entity of the array, such that you don't have to care whether you obtained one from via List or Get operation. (And then potentially restore
get_foos.kind
to be "FooList".)The text was updated successfully, but these errors were encountered: