-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Cannot list endpointslices using python kubernetes client #2214
Comments
/assign |
@bpinske from the Kubernetes source code, we can see the |
maybe this is my ignorance showing, but how does that say endpoints cannot be null? I have many endpointslices it seems which have null endpoints. Including very old stuff like Helm Tiller which I haven't used in years. So it definitely happens regularly and as a normal thing. I don't think the python client library should fail to handle this when the Go library does handle it properly. Further, I ended up just writing my tool in golang to unblock mysel. I do have the desired and expected behaviour when using Go. Here is a simple Go version which does have the expected behaviour and does handle null endpoints.
outputs
|
Hi @bpinske , sorry, it's my stupid mistake, the source code means field |
Hi @roycaihw , this endpoints is not validated properly, it's generated by OpenAPI Generator automatically and not allowed to edit manually, hence I check the Kubernetes source code and find that there are specific validation functions() validating the endpointslices and endpoints in validation.go,but they are not generated by OpenAPI Generator as expected. |
Issue #1662 can resolve this problem by disabling the client side validation |
Hi @showjason, I am using it inside a watcher can you tell me where to add from kubernetes import watch, config, client
apiserver = client.DiscoveryV1Api()
apiserver.api_client.client_side_validation = False
watcher = watch.Watch()
for event in watcher.stream(apiserver.list_namespaced_endpoint_slice, 'default', label_selector=label_selector, timeout_seconds=10):
print(event) |
Hi @anupamdialpad, Let's take The way to address this issue is to set the param
|
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
What happened (please include outputs or screenshots):
Cannot list endpoint slices using the kubernetes python library in a cluster where one of the endpoint slices contains a null list of endpoints.
Fails with the following stack trace.
What you expected to happen:
Expected a list of endpointslices to be returned.
How to reproduce it (as minimally and precisely as possible):
Create an endpointslice with endpoints as null. See bottom of issue for example of null endpoints.
Execute this code on any kubernetes cluster.
Anything else we need to know?:
Noteworthy that if I debug this a bit, I do see that I am receiving the EndpointSliceList correctly from the apiserver, but the client is struggling to do...something with it.
====
After further investigation, it appears related to endpointslices with null endpoints for example. If I debug down, I find that it's failing to deserialize on this particular endpointslice in my cluster.
The text was updated successfully, but these errors were encountered: