summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Dulko <mdulko@redhat.com>2017-11-21 09:56:59 +0100
committerMichał Dulko <mdulko@redhat.com>2017-11-21 11:22:49 +0100
commite6c01efdc4fe035b2cc02fb2003aa9a9e9e1252e (patch)
tree94da8ae8b942a22eea04f1348fcb479274975707
parent0a820212fe0681300044c7259afa227d214ef5a3 (diff)
Fix `create_pod` for 4.0 kubernetes client
4.0 version of kubernetes pypi package was released. It changes the V1Container and V1PodSpec parameter validation and now requires name and containers fields respectively to always be provided to the constructors. This commit fixes that. A successful run of the fix agains kuryr-kubernetes repo can be seen on Ie282feac157f454b61fd259a3e122fbf97199950. Closes-Bug: 1733538 Change-Id: I96d2ad16033fa0ebac0f97b0f7d28ed3f933e227
Notes
Notes (review): Code-Review+2: Daniel Mellado <dmellado@redhat.com> Code-Review+2: Antoni Segura Puimedon <celebdor@gmail.com> Workflow+1: Antoni Segura Puimedon <celebdor@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 21 Nov 2017 11:51:27 +0000 Reviewed-on: https://review.openstack.org/521762 Project: openstack/kuryr-tempest-plugin Branch: refs/heads/master
-rw-r--r--kuryr_tempest_plugin/tests/scenario/base.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/kuryr_tempest_plugin/tests/scenario/base.py b/kuryr_tempest_plugin/tests/scenario/base.py
index ca13bc0..eb3bc19 100644
--- a/kuryr_tempest_plugin/tests/scenario/base.py
+++ b/kuryr_tempest_plugin/tests/scenario/base.py
@@ -57,13 +57,11 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest):
57 pod = self.k8s_client.V1Pod() 57 pod = self.k8s_client.V1Pod()
58 pod.metadata = self.k8s_client.V1ObjectMeta(name=name) 58 pod.metadata = self.k8s_client.V1ObjectMeta(name=name)
59 59
60 container = self.k8s_client.V1Container() 60 container = self.k8s_client.V1Container(name=name)
61 container.image = image 61 container.image = image
62 container.args = ["sleep", "3600"] 62 container.args = ["sleep", "3600"]
63 container.name = name
64 63
65 spec = self.k8s_client.V1PodSpec() 64 spec = self.k8s_client.V1PodSpec(containers=[container])
66 spec.containers = [container]
67 65
68 pod.spec = spec 66 pod.spec = spec
69 self.k8s_client.CoreV1Api().create_namespaced_pod(namespace=namespace, 67 self.k8s_client.CoreV1Api().create_namespaced_pod(namespace=namespace,