From 1f8cfc5c980d7abab86e29030c1e134769421278 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Wed, 11 Aug 2021 09:15:12 +0200 Subject: [PATCH] small fix for setting bools in Postgres config --- e2e/tests/test_e2e.py | 10 +++++----- pkg/cluster/sync.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/e2e/tests/test_e2e.py b/e2e/tests/test_e2e.py index 6a4bf78ca..ac9bb9398 100644 --- a/e2e/tests/test_e2e.py +++ b/e2e/tests/test_e2e.py @@ -1098,19 +1098,19 @@ class EndToEndTestCase(unittest.TestCase): def compare_config(): effective_config = k8s.patroni_rest(masterPod.metadata.name, "config") - desired_patroni = pg_patch_config["spec"]["patroni"] + desired_config = pg_patch_config["spec"]["patroni"] desired_parameters = pg_patch_config["spec"]["postgresql"]["parameters"] effective_parameters = effective_config["postgresql"]["parameters"] self.assertEqual(desired_parameters["max_connections"], effective_parameters["max_connections"], "max_connections not updated") self.assertTrue(effective_config["slots"] is not None, "physical replication slot not added") - self.assertEqual(desired_patroni["ttl"], effective_config["ttl"], + self.assertEqual(desired_config["ttl"], effective_config["ttl"], "ttl not updated") - self.assertEqual(desired_patroni["loop_wait"], effective_config["loop_wait"], + self.assertEqual(desired_config["loop_wait"], effective_config["loop_wait"], "loop_wait not updated") - self.assertEqual(desired_patroni["retry_timeout"], effective_config["retry_timeout"], + self.assertEqual(desired_config["retry_timeout"], effective_config["retry_timeout"], "retry_timeout not updated") - self.assertEqual(desired_patroni["synchronous_mode"], effective_config["synchronous_mode"], + self.assertEqual(desired_config["synchronous_mode"], effective_config["synchronous_mode"], "synchronous_mode not updated") return True diff --git a/pkg/cluster/sync.go b/pkg/cluster/sync.go index 0b33ade4d..de3d1ad11 100644 --- a/pkg/cluster/sync.go +++ b/pkg/cluster/sync.go @@ -416,10 +416,10 @@ func (c *Cluster) syncStatefulSet() error { if c.Spec.Patroni.TTL > 0 { desiredPostgresConfig["ttl"] = c.Spec.Patroni.TTL } - if effectivePostgresConfig["synchronous_mode"] != desiredPostgresConfig["synchronous_mode"] { + if effectivePostgresConfig["synchronous_mode"] != c.Spec.Patroni.SynchronousMode { desiredPostgresConfig["synchronous_mode"] = c.Spec.Patroni.SynchronousMode } - if effectivePostgresConfig["synchronous_mode_strict"] != desiredPostgresConfig["synchronous_mode_strict"] { + if effectivePostgresConfig["synchronous_mode_strict"] != c.Spec.Patroni.SynchronousModeStrict { desiredPostgresConfig["synchronous_mode_strict"] = c.Spec.Patroni.SynchronousModeStrict }