Skip to content

Commit

Permalink
chore: update charm libraries (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
observability-noctua-bot authored Feb 7, 2025
1 parent 82920cf commit bfab5f6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/charms/grafana_k8s/v0/grafana_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def __init__(self, *args):
# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version

LIBPATCH = 39
LIBPATCH = 41

PYDEPS = ["cosl >= 0.0.50"]

Expand Down Expand Up @@ -417,8 +417,7 @@ def __init__(
self.expected_relation_interface = expected_relation_interface
self.actual_relation_interface = actual_relation_interface
self.message = (
"The '{}' relation has '{}' as "
"interface rather than the expected '{}'".format(
"The '{}' relation has '{}' as " "interface rather than the expected '{}'".format(
relation_name, actual_relation_interface, expected_relation_interface
)
)
Expand Down Expand Up @@ -634,7 +633,10 @@ def _replace_template_fields( # noqa: C901
deletions = []
for tmpl in dict_content["templating"]["list"]:
if tmpl["name"] and tmpl["name"] in used_replacements:
deletions.append(tmpl)
# it might happen that existing template var name is the same as the one we insert (i.e prometheusds or lokids)
# in that case, we want to pop the existing one only.
if tmpl not in DATASOURCE_TEMPLATE_DROPDOWNS:
deletions.append(tmpl)

for d in deletions:
dict_content["templating"]["list"].remove(d)
Expand Down Expand Up @@ -1601,7 +1603,7 @@ def _render_dashboards_and_signal_changed(self, relation: Relation) -> bool: #

if not coerced_data == stored_data:
stored_dashboards = self.get_peer_data("dashboards")
stored_dashboards[relation.id] = stored_data
stored_dashboards[str(relation.id)] = stored_data
self.set_peer_data("dashboards", stored_dashboards)
return True
return None # type: ignore
Expand Down

0 comments on commit bfab5f6

Please # to comment.