-
Notifications
You must be signed in to change notification settings - Fork 145
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
[4.0 client] kubernetes.client.apis.apps_v1beta1_api.AppsV1beta1Api.get_api_resources() crashes on OpenShift 3.6 #139
Comments
I believe I'm also hitting this like this on my 3.6 cluster with openshift==0.4.1. # roughly...
from openshift import config as oconfig, client as oclient
project.oapi = oclient.OapiApi()
project.oapi.list_namespaced_role_binding(project.name)
Any tips to work around, or just downgrade releases and wait? |
FWIW same issue with:
|
I'm currently using this monkey-patch to work around a similar issue in Kubernetes: I haven't bothered to put together a monkey-patch to fix this problem. If you do, please post it here? I wouldn't hold my breath waiting for this bug to be fixed. I filed it upstream three months ago when the 4.0 client was in beta, they closed my bug even though it was still there, and no one's paid any attention to it since despite the steadily-accumulating list of issues that can be traced to the same cause. |
Thanks for the commiseration. To be most explicit this is what I'm seeing with kubernetes==4.0.0
|
Same behavior after openshift upgrade:
With only a marginal understanding, I have produced this monkey patch which has gotten me past the above and a subsequent ValueError: # API server is returning invalid values according to the demands
# of the swagger generated API client. This monkeypatch works
# around the bugs I have run into so far.
#
# Related issues:
# - https://github.com/kubernetes-client/python/issues/415
# - https://github.com/openshift/openshift-restclient-python/issues/139
# - https://github.com/kubernetes-client/python/issues/418
# - https://github.com/kubernetes-client/python/issues/394
# tripped by openshift.client.OapiApi.list_namespaced_role_binding()
from kubernetes.client.models.v1_role_ref import V1RoleRef
@property
def kind(self):
return self._kind
@kind.setter
def kind(self, kind):
if kind is None:
kind = ''
self._kind = kind
@property
def api_group(self):
return self._api_group
@api_group.setter
def api_group(self, api_group):
if api_group is None:
api_group = ''
self._api_group = api_group
V1RoleRef.kind = kind
V1RoleRef.api_group = api_group |
Unfortunately if the error is coming from the kubernetes client we don't have any control of how they handle validation. You'll have to refile the issue against github.com/kubernetes-client/python. I've seen this and attempted to fix/workaround it on a few of the openshift models (still haven't found a good root cause/fix yet though). I'm sorry you're still seeing this after so long, I'll see if I can get the kubernetes-client maintainers' attention. If you do refile, please ping me on the issue and I can bump it. |
This is a backwards-compatibility issue.
In the 4.0 client, there's a bunch of additional validation code added to ensure that required fields can't be null/None. Unfortunately, the Kubernetes API server will still return null/None values for some of these fields even though they're supposedly required. I have a slightly more detailed explanation of a similar bug here: kubernetes-client/python#394 . (It's closed but the issue is not fixed.) I don't know if this is a bug in the OpenShift 3.6 API server (it's returning null for a required field) or the OpenAPI spec (the field shouldn't be required).
The text was updated successfully, but these errors were encountered: