Skip to content

Commit

Permalink
only set LEADER_HOST_KEY in redis-relation data if Sentinel leader wa…
Browse files Browse the repository at this point in the history
…s elected already (#98)
  • Loading branch information
reneradoi authored Sep 9, 2024
1 parent 63b8cfa commit fb68104
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ def _on_redis_relation_created(self, event):
return

self._peers.data[self.app]["enable-password"] = "false"
event.relation.data[self.app][LEADER_HOST_KEY] = self.current_master
if self.current_master:
event.relation.data[self.app][LEADER_HOST_KEY] = self.current_master

self._update_layer()

Expand Down

0 comments on commit fb68104

Please sign in to comment.