You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: The deployment still goes through despite the python error that's trown. The same workd on OCP 3.5+
[root@localhost ~]# oc version oc v3.4.1.44.38
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO
Server https://x.x.x.x:8443
openshift v3.4.1.44.38
kubernetes v1.4.0+776c994
[root@localhost ~]# pip show openshift Name: openshift
Version: 0.4.0
Summary: OpenShift python client
Home-page: https://github.com/openshift/openshift-restclient-python
Author: OpenShift
Author-email: UNKNOWN
License: Apache License Version 2.0
Location: /usr/lib/python2.7/site-packages/openshift-0.4.0-py2.7.egg
Requires: dictdiffer, jinja2, kubernetes, python-string-utils, ruamel.yaml, six
[root@localhost ~]# python
Python 2.7.5 (default, May 3 2017, 07:55:04)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from openshift import client, config
from pprint import pprint
import json
config.load_kube_config()
api_instance = client.OapiApi()
namespace = 'badre'
pretty = 'pretty_example'
with open('processed_deploymentconfig.json') as jd:
... body = json.load(jd)
...
pprint(body)
{u'apiVersion': u'v1',
u'kind': u'DeploymentConfig',
u'metadata': {u'labels': {u'app': u'fio'}, u'name': u'fio-4caky8mwlx'},
u'spec': {u'replicas': 1,
u'selector': {u'app': u'fio', u'deploymentconfig': u'fio'},
u'strategy': {u'type': u'Rolling'},
u'template': {u'metadata': {u'labels': {u'app': u'fio',
u'deploymentconfig': u'fio',
u'name': u'fio'}},
u'spec': {u'containers': [{u'image': u' ',
u'imagePullPolicy': u'Always',
u'name': u'fio',
u'resources': {},
u'terminationMessagePath': u'/dev/termination-log',
u'volumeMounts': [{u'mountPath': u'/usr/share/fio',
u'name': u'fio-data'}]}],
u'volumes': [{u'name': u'fio-data',
u'persistentVolumeClaim': {u'claimName': u'fio-4caky8mwlx'}}]}},
u'test': False,
u'triggers': [{u'imageChangeParams': {u'automatic': True,
u'containerNames': [u'fio'],
u'from': {u'kind': u'ImageStreamTag',
u'name': u'fio:latest'}},
u'type': u'ImageChange'}]}}
api_response = api_instance.create_namespaced_deployment_config(namespace, body, pretty=pretty)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/openshift-0.4.0-py2.7.egg/openshift/client/apis/oapi_api.py", line 2752, in create_namespaced_deployment_config
(data) = self.create_namespaced_deployment_config_with_http_info(namespace, body, **kwargs)
File "/usr/lib/python2.7/site-packages/openshift-0.4.0-py2.7.egg/openshift/client/apis/oapi_api.py", line 2837, in create_namespaced_deployment_config_with_http_info
collection_formats=collection_formats)
File "/usr/lib/python2.7/site-packages/kubernetes-4.0.0-py2.7.egg/kubernetes/client/api_client.py", line 321, in call_api
_return_http_data_only, collection_formats, _preload_content, _request_timeout)
File "/usr/lib/python2.7/site-packages/kubernetes-4.0.0-py2.7.egg/kubernetes/client/api_client.py", line 163, in __call_api
return_data = self.deserialize(response_data, response_type)
File "/usr/lib/python2.7/site-packages/kubernetes-4.0.0-py2.7.egg/kubernetes/client/api_client.py", line 236, in deserialize
return self.__deserialize(data, response_type)
File "/usr/lib/python2.7/site-packages/openshift-0.4.0-py2.7.egg/openshift/client/api_client.py", line 17, in _ApiClient__deserialize
return super(ApiClient, self).__deserialize_model(data, klass)
File "/usr/lib/python2.7/site-packages/kubernetes-4.0.0-py2.7.egg/kubernetes/client/api_client.py", line 620, in __deserialize_model
kwargs[attr] = self.__deserialize(value, attr_type)
File "/usr/lib/python2.7/site-packages/openshift-0.4.0-py2.7.egg/openshift/client/api_client.py", line 17, in _ApiClient__deserialize
return super(ApiClient, self).__deserialize_model(data, klass)
File "/usr/lib/python2.7/site-packages/kubernetes-4.0.0-py2.7.egg/kubernetes/client/api_client.py", line 622, in __deserialize_model
instance = klass(**kwargs)
File "/usr/lib/python2.7/site-packages/openshift-0.4.0-py2.7.egg/openshift/client/models/v1_deployment_config_status.py", line 73, in init
self.available_replicas = available_replicas
File "/usr/lib/python2.7/site-packages/openshift-0.4.0-py2.7.egg/openshift/client/models/v1_deployment_config_status.py", line 107, in available_replicas raise ValueError("Invalid value for available_replicas, must not be None")
ValueError: Invalid value for available_replicas, must not be None
available_replicas is a key of the V1DeploymentConfigStatus which is the body for the 'status' key in the V1DeploymentConfig object. That status key however is supposed to be optional
The text was updated successfully, but these errors were encountered:
This is the same underlying issue as #139 and kubernetes-client/python#394, an API call that returns null and then crashes because of new validation code in 4.0 client.
NOTE: The deployment still goes through despite the python error that's trown. The same workd on OCP 3.5+
[root@localhost ~]# oc version
oc v3.4.1.44.38
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO
Server https://x.x.x.x:8443
openshift v3.4.1.44.38
kubernetes v1.4.0+776c994
[root@localhost ~]# pip show openshift
Name: openshift
Version: 0.4.0
Summary: OpenShift python client
Home-page: https://github.com/openshift/openshift-restclient-python
Author: OpenShift
Author-email: UNKNOWN
License: Apache License Version 2.0
Location: /usr/lib/python2.7/site-packages/openshift-0.4.0-py2.7.egg
Requires: dictdiffer, jinja2, kubernetes, python-string-utils, ruamel.yaml, six
[root@localhost ~]# python
Python 2.7.5 (default, May 3 2017, 07:55:04)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
available_replicas is a key of the V1DeploymentConfigStatus which is the body for the 'status' key in the V1DeploymentConfig object. That status key however is supposed to be optional
The text was updated successfully, but these errors were encountered: