Skip to content
Open
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: 6 additions & 2 deletions lib/charms/mysql/v0/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def wait_until_mysql_connection(self) -> None:
# Increment this major API version when introducing breaking changes
LIBAPI = 0

LIBPATCH = 92
LIBPATCH = 93

UNIT_TEARDOWN_LOCKNAME = "unit-teardown"
UNIT_ADD_LOCKNAME = "unit-add"
Expand Down Expand Up @@ -874,7 +874,11 @@ def get_cluster_endpoints(self, relation_name: str) -> tuple[str, str, str]:
if v["status"] == MySQLMemberState.RECOVERING:
continue

address = f"{self.get_unit_address(unit_labels[k], relation_name)}:3306"
# skip if unit not available in unit_labels
if unit_label := unit_labels.get(k):
address = f"{self.get_unit_address(unit_label, relation_name)}:3306"
else:
continue

if v["status"] != MySQLMemberState.ONLINE:
no_endpoints.add(address)
Expand Down
Loading