Skip to content

Commit 0a0a6fe

Browse files
authored
fix: Only update databag is not shard (#346)
1 parent f0a7578 commit 0a0a6fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/charm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,8 @@ def _reconcile_mongo_hosts_and_users(self, event: RelationEvent) -> None:
744744
self._add_units_from_replica_set(event, mongo, mongodb_hosts - replset_members)
745745

746746
# app relations should be made aware of the new set of hosts
747-
self.client_relations.update_app_relation_data()
747+
if not self.is_role(Config.Role.SHARD):
748+
self.client_relations.update_app_relation_data()
748749

749750
except NotReadyError:
750751
self.status.set_and_share_status(
@@ -1574,8 +1575,8 @@ def is_relation_feasible(self, rel_interface: str) -> bool:
15741575
)
15751576
logger.error(
15761577
"Charm is in sharding role: %s. Does not support %s interface.",
1577-
rel_interface,
15781578
self.role,
1579+
rel_interface,
15791580
)
15801581
return False
15811582

0 commit comments

Comments
 (0)