Skip to content

Commit

Permalink
update ds names on relation removal
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldmitry committed Nov 28, 2024
1 parent 82dc57d commit 3c2a2ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/charms/grafana_k8s/v0/grafana_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,12 @@ def _remove_source_from_datastore(self, event: RelationDepartedEvent) -> bool:
self._remove_source(host["source_name"])

self.set_peer_data("sources", stored_sources)

# remove this datasource name from the published datasource names shared with the datasource units
self._publish_source_uids(
event.relation, {ds["unit"]: ds["source_name"] for ds in stored_sources[rel_id]}
)

return True
return False

Expand Down

0 comments on commit 3c2a2ee

Please sign in to comment.