Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions single_kernel_mongo/managers/sharding.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,6 @@ def synchronise_cluster_secrets(self, relation: Relation, leaving: bool = False)
logger.info("Waiting for secrets from config-server")
raise WaitingForSecretsError("Missing keyfile")

# Let's start by updating the passwords, before any restart so they are in sync already.
if self.charm.unit.is_leader():
self.sync_cluster_passwords(operator_password, backup_password)

self.update_member_auth(keyfile, tls_ca, external_tls_ca)

self.update_pbm_certificate_in_trust_store()
Expand All @@ -600,6 +596,10 @@ def synchronise_cluster_secrets(self, relation: Relation, leaving: bool = False)
logger.info("MongoDB is not ready")
raise NotReadyError

# Let's start by updating the passwords, before any restart so they are in sync already.
if self.charm.unit.is_leader():
self.sync_cluster_passwords(operator_password, backup_password)

# By setting the status we ensure that the former statuses of this component are removed.
self.state.statuses.set(ShardStatuses.ACTIVE_IDLE.value, scope="unit", component=self.name)

Expand Down
Loading