From c5e610097d4579e4d47e28dce47dc9719d70f14f Mon Sep 17 00:00:00 2001 From: Dragomir Penev <6687393+dragomirp@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:19:33 +0200 Subject: [PATCH] Only update tls flags on leader (#770) --- src/relations/postgresql_provider.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/relations/postgresql_provider.py b/src/relations/postgresql_provider.py index b6398f8216..17695c051b 100644 --- a/src/relations/postgresql_provider.py +++ b/src/relations/postgresql_provider.py @@ -211,6 +211,9 @@ def update_read_only_endpoint(self, event: DatabaseRequestedEvent = None) -> Non def update_tls_flag(self, tls: str) -> None: """Update TLS flag and CA in relation databag.""" + if not self.charm.unit.is_leader(): + return + relations = self.model.relations[self.relation_name] if tls == "True": _, ca, _ = self.charm.tls.get_tls_files()