Skip to content

Commit

Permalink
Update dashboards when relation broken (#285)
Browse files Browse the repository at this point in the history
Previously, when the relation between grafana-agent
and a charm providing a dashboard
(over the grafana-dashboards-consumer relation)
was broken, the dashboards would not be removed.
This fixes that issue, by also running the dashboards changed method
when the relation is broken.
  • Loading branch information
samuelallan72 authored Apr 10, 2024
1 parent d98de15 commit 6915307
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ def __init__(self, *args):
self.on["grafana-dashboards-consumer"].relation_changed,
self._on_dashboards_changed,
)
self.framework.observe(
self.on["grafana-dashboards-consumer"].relation_broken,
self._on_dashboards_changed,
)

self.framework.observe(
self.on.agent_pebble_ready, # pyright: ignore
Expand Down

0 comments on commit 6915307

Please sign in to comment.