mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
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:
@@ -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
@@ -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.*
|
||||
|
||||
@@ -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'}})
|
||||
|
||||
Reference in New Issue
Block a user