Deserialize Labels properly
Switch from 'object' to 'dict(str, str)' so that the labels information is not lost. Change-Id: I971ef230cda8b2ba5997ab71c622323956fcfbdd
This commit is contained in:
parent
a2169399ae
commit
4f0b170a5f
@ -45,7 +45,7 @@ class V1ObjectMeta(object):
|
|||||||
'creation_timestamp': 'str',
|
'creation_timestamp': 'str',
|
||||||
'deletion_timestamp': 'str',
|
'deletion_timestamp': 'str',
|
||||||
'deletion_grace_period_seconds': 'int',
|
'deletion_grace_period_seconds': 'int',
|
||||||
'labels': 'object',
|
'labels': 'dict(str, str)',
|
||||||
'annotations': 'object'
|
'annotations': 'object'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class V1ObjectMeta(object):
|
|||||||
'creation_timestamp': 'str',
|
'creation_timestamp': 'str',
|
||||||
'deletion_timestamp': 'str',
|
'deletion_timestamp': 'str',
|
||||||
'deletion_grace_period_seconds': 'int',
|
'deletion_grace_period_seconds': 'int',
|
||||||
'labels': 'object',
|
'labels': 'dict(str, str)',
|
||||||
'annotations': 'object'
|
'annotations': 'object'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class V1ObjectMeta(object):
|
|||||||
'creation_timestamp': 'str',
|
'creation_timestamp': 'str',
|
||||||
'deletion_timestamp': 'str',
|
'deletion_timestamp': 'str',
|
||||||
'deletion_grace_period_seconds': 'int',
|
'deletion_grace_period_seconds': 'int',
|
||||||
'labels': 'object',
|
'labels': 'dict(str, str)',
|
||||||
'annotations': 'object'
|
'annotations': 'object'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,6 +191,18 @@ class TestK8sclient(base.TestCase):
|
|||||||
name='test-configmap', body={}, namespace='default')
|
name='test-configmap', body={}, namespace='default')
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipUnless(
|
||||||
|
_is_k8s_running(), "Kubernetes is not available")
|
||||||
|
def test_node_apis(self):
|
||||||
|
client = api_client.ApiClient('http://127.0.0.1:8080/')
|
||||||
|
api = apiv_api.ApivApi(client)
|
||||||
|
|
||||||
|
for item in api.list_namespaced_node().items:
|
||||||
|
node = api.read_namespaced_node(name=item.metadata.name)
|
||||||
|
self.assertTrue(len(node.metadata.labels) > 0)
|
||||||
|
self.assertTrue(isinstance(node.metadata.labels, dict))
|
||||||
|
|
||||||
|
|
||||||
class TestK8sclientBeta(base.TestCase):
|
class TestK8sclientBeta(base.TestCase):
|
||||||
@unittest.skipUnless(
|
@unittest.skipUnless(
|
||||||
_is_k8s_running(), "Kubernetes is not available")
|
_is_k8s_running(), "Kubernetes is not available")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user