Override write_leader_optime method in K8s implementation (#2850)

It is being called when postgres is already shut down cleanly but there are no healthy replicas to take it over.

Close https://github.com/zalando/patroni/issues/2837
Close https://github.com/zalando/patroni/pull/2838
This commit is contained in:
Alexander Kukushkin
2023-09-05 07:41:45 +02:00
committed by GitHub
parent 89a162e000
commit 941e883dde
2 changed files with 11 additions and 0 deletions
+4
View File
@@ -436,6 +436,10 @@ class TestKubernetesEndpoints(BaseTestKubernetes):
mock_logger_exception.assert_called_once()
self.assertEqual(('create_config_service failed',), mock_logger_exception.call_args[0])
@patch.object(k8s_client.CoreV1Api, 'patch_namespaced_endpoints', mock_namespaced_kind, create=True)
def test_write_leader_optime(self):
self.k.write_leader_optime(12345)
def mock_watch(*args):
return urllib3.HTTPResponse()