From e6c01efdc4fe035b2cc02fb2003aa9a9e9e1252e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dulko?= Date: Tue, 21 Nov 2017 09:56:59 +0100 Subject: [PATCH] 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 --- kuryr_tempest_plugin/tests/scenario/base.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kuryr_tempest_plugin/tests/scenario/base.py b/kuryr_tempest_plugin/tests/scenario/base.py index ca13bc08..eb3bc19d 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): pod = self.k8s_client.V1Pod() pod.metadata = self.k8s_client.V1ObjectMeta(name=name) - container = self.k8s_client.V1Container() + container = self.k8s_client.V1Container(name=name) container.image = image container.args = ["sleep", "3600"] - container.name = name - spec = self.k8s_client.V1PodSpec() - spec.containers = [container] + spec = self.k8s_client.V1PodSpec(containers=[container]) pod.spec = spec self.k8s_client.CoreV1Api().create_namespaced_pod(namespace=namespace,