diff --git a/src/charm.py b/src/charm.py index 044fe41ee6..7881369163 100755 --- a/src/charm.py +++ b/src/charm.py @@ -186,11 +186,6 @@ def _on_peer_relation_changed(self, event: RelationChangedEvent) -> None: # one at a time. if self.unit.is_leader(): self._add_members(event) - else: - # Update the Patroni configuration in this unit to use new passwords when they change. - # The config is reloaded later in `update_cluster_members` if the member has already - # started, or it is loaded the first time Patroni starts. - self._patroni.render_patroni_yml_file() # Don't update this member before it's part of the members list. if self._endpoint not in self._endpoints: @@ -506,7 +501,7 @@ def _on_set_password(self, event: ActionEvent) -> None: self._set_secret("app", f"{username}-password", password) # Update and reload Patroni configuration in this unit to use the new password. - # Other units Patroni configuration will be + # Other units Patroni configuration will be reloaded in the peer relation changed event. self._patroni.render_patroni_yml_file() self._patroni.reload_patroni_configuration() diff --git a/tests/integration/test_password_rotation.py b/tests/integration/test_password_rotation.py new file mode 100644 index 0000000000..e69de29bb2