-
Notifications
You must be signed in to change notification settings - Fork 148
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
Required arrays with null value #52
Comments
There are a number of other API fields with this problem. From watching the issues in the two repositories in question, I have the following list. (This is just straight links, I don't have time right now to make the formatting pretty. I tried to avoid duplicates.) Kuberneteskubernetes-client/python#491 OpenShiftkubernetes-client/python#464 There are probably more that I haven't run into and that no one else has bothered to post an issue for yet. |
Looking at related issues (specifically #394) This has been an issue since at least November. Is there any word on a fix or a workaround? As someone new to Kubernetes and even newer to the Python client, I have absolutely no idea how to move past this and make my application work. |
@smiller171 For good or ill, I've managed to work around this in my kubernetes-python module by commenting out the subject enforcement check at lines 184 & 185 of my /usr/local/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_cluster_role_binding.py file (the content being):
|
I just came across this issue with the "limits" array in the LimitRangeSpec resource. If I write a LimitRange object with an empty array, when reading it back, I get the exception: "Invalid value for This seems to be a serious, pervasive issue with at least the 5.0.0 library. Is that accurate, or am I misunderstanding something? Is there any fix in the works? Or suggested workaround other than dealing with each and every occurrence? So far, in my project, we've had to implement workarounds for this limits case, and the PodDisruptionBudget case (kubernetes-client/python#466). This issue (#52) makes it appear there could be many more problems lurking out there. Do we need to give up on 5.0.0, and go back to an earlier stable library release? |
Upstream PR fixing |
Fixes for |
Given that apiserver ignores the rule today, everything just works better if we adjust the specs to mark these fields as optional, no? |
Also, see kubernetes/kube-openapi#87 |
@roycaihw you can check |
@mydockergit The field is still marked as required, as openapi spec shows:
I think kubernetes-client/python#447 was closed because we want to fix the API upstream |
Any luck with this? |
Hi There, I am running python 3.7.2 and hit the same problem trying to deploy sql aag onto AKS, by running "python ./deploy-ag.py ...". But the AKS is created. Is there anything i need to do to fix up the errors and how? Thanks & regards, |
It seems caused by the issue of type hinting or some other similar @ikflc here's a quick but dirty patch
Test passed in Python 3.7.2 / Kubeclient-Python v9.0.0 / Kubernetes 1.13.5 |
@roycaihw looks like some of your fix PRs didn't get enough attention, maybe you can revisit them? |
@kubernetes/sig-api-machinery-bugs, we have the same problem |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Am I running into this here, or shall I raise a separate issue? Code straight from one of the examples:
|
I get similar results when calling list_api_service(): However, service is None whenever a service is Local (which is most of them). And when calling list_controller_revision_for_all_namespaces(): RuntimeRawExtension is explicitly listed as [optional] in the documentation for V1ControllerRevision, but is treated as mandatory by the bindings. I've only tested with version 10.1.0 of the bindings, but checking the source code for 11.0.0 seems to indicate that the issue is still there. |
* Gets raw data from Kubernetes and avoids OpenAPI deserialization which fails due to kubernetes-client/gen#52, even though [this fix](kubernetes/kubernetes#85728) exists, the Python Kubernetes library is still not compatible with it. More information at kubernetes-client/python#1174.
* Gets raw data from Kubernetes and avoids OpenAPI deserialization which fails due to kubernetes-client/gen#52, even though [this fix](kubernetes/kubernetes#85728) exists, the Python Kubernetes library is still not compatible with it. More information at kubernetes-client/python#1174.
Looks like there is a problem with 1.8 spec going forward [TODO:ref issue] that an array that marked as required can be null. Assuming an empty array is an acceptable array in these situation (and it look like it is as kubernetes return empty array in some of those cases, TODO: add ref issues) we should consider fixing it in the main repo (TODO: create an issue) and also here as a quick fix until main repo issue has been fixed. This is my brain dump on the issue in case of anyone wants to work on this:
The text was updated successfully, but these errors were encountered: