small fix for setting bools in Postgres config
This commit is contained in:
parent
4862b05c69
commit
1f8cfc5c98
|
|
@ -1098,19 +1098,19 @@ class EndToEndTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def compare_config():
|
def compare_config():
|
||||||
effective_config = k8s.patroni_rest(masterPod.metadata.name, "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"]
|
desired_parameters = pg_patch_config["spec"]["postgresql"]["parameters"]
|
||||||
effective_parameters = effective_config["postgresql"]["parameters"]
|
effective_parameters = effective_config["postgresql"]["parameters"]
|
||||||
self.assertEqual(desired_parameters["max_connections"], effective_parameters["max_connections"],
|
self.assertEqual(desired_parameters["max_connections"], effective_parameters["max_connections"],
|
||||||
"max_connections not updated")
|
"max_connections not updated")
|
||||||
self.assertTrue(effective_config["slots"] is not None, "physical replication slot not added")
|
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")
|
"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")
|
"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")
|
"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")
|
"synchronous_mode not updated")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -416,10 +416,10 @@ func (c *Cluster) syncStatefulSet() error {
|
||||||
if c.Spec.Patroni.TTL > 0 {
|
if c.Spec.Patroni.TTL > 0 {
|
||||||
desiredPostgresConfig["ttl"] = c.Spec.Patroni.TTL
|
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
|
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
|
desiredPostgresConfig["synchronous_mode_strict"] = c.Spec.Patroni.SynchronousModeStrict
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue