A few small fixes (#1221)

* fix some warnings when running unit-tests
* allow python-kubernetes up to 10.0.1
* python-consul>=0.7.1 is required due to #802
This commit is contained in:
Alexander Kukushkin
2019-10-11 10:15:22 +02:00
committed by GitHub
parent c95275665f
commit 21ed8e2d09
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -473,7 +473,7 @@ class KubernetesController(AbstractDcsController):
def delete_pod(self, name):
try:
self._api.delete_namespaced_pod(name, self._namespace, self._client.V1DeleteOptions())
self._api.delete_namespaced_pod(name, self._namespace, body=self._client.V1DeleteOptions())
except:
pass
while True:
+2 -2
View File
@@ -5,11 +5,11 @@ requests
six >= 1.7
kazoo>=1.3.1
python-etcd>=0.4.3,<0.5
python-consul>=0.7.0
python-consul>=0.7.1
click>=4.1
prettytable>=0.7
tzlocal
python-dateutil
psutil>=2.0.0
cdiff
kubernetes>=2.0.0,<=7.0.0,!=4.0.*,!=5.0.*
kubernetes>=2.0.0,<=10.0.1,!=4.0.*,!=5.0.*
+3
View File
@@ -29,12 +29,14 @@ def mock_list_namespaced_pod(self, *args, **kwargs):
@patch.object(k8s_client.CoreV1Api, 'patch_namespaced_config_map', Mock())
@patch.object(k8s_client.CoreV1Api, 'create_namespaced_config_map', Mock())
@patch('kubernetes.client.api_client.ThreadPool', Mock(), create=True)
@patch.object(Thread, 'start', Mock())
class TestKubernetes(unittest.TestCase):
@patch('kubernetes.config.load_kube_config', Mock())
@patch.object(k8s_client.CoreV1Api, 'list_namespaced_config_map', mock_list_namespaced_config_map)
@patch.object(k8s_client.CoreV1Api, 'list_namespaced_pod', mock_list_namespaced_pod)
@patch('kubernetes.client.api_client.ThreadPool', Mock(), create=True)
@patch.object(Thread, 'start', Mock())
def setUp(self):
self.k = Kubernetes({'ttl': 30, 'scope': 'test', 'name': 'p-0', 'retry_timeout': 10, 'labels': {'f': 'b'}})
@@ -135,6 +137,7 @@ class TestKubernetes(unittest.TestCase):
class TestKubernetesWatcher(unittest.TestCase):
@patch('kubernetes.config.load_kube_config', Mock())
@patch('kubernetes.client.api_client.ThreadPool', Mock(), create=True)
@patch.object(Thread, 'start', Mock())
def setUp(self):
self.k = Kubernetes({'ttl': 30, 'scope': 'test', 'name': 'p-0', 'retry_timeout': 10, 'labels': {'f': 'b'}})