Closed cbartz closed 3 months ago
I'm not sure that that is the issue, because while the relation provider class is in fact only doing that 'automatically' on install and upgrade, the charm itself is doing that in its common exit hook (https://github.com/canonical/cos-configuration-k8s-operator/blob/051e1461430edb2d342f8b2088a79d363fd02140/src/charm.py#L162C22-L162C22)
which is triggered, among other things, on config-changed.
So there must be something else going on. Perhaps a bug in the hashing?
Thanks @PietroPasotti for the quick reply. It seems that the update of the boards is not triggered if the git hash does not change, which is indeed true in this case because the config grafana_dashboards
is independent of the hash.
We should probably just always update on config-changed.
The issue isn't reproducible when following the original steps and the updated dashboards path in the github-runner-operator
(grafana_dashboards_path=src/grafana_dashboards
).
However, the issue arises if step 4 is performed before step 3 in the reproduction steps (i.e., relating to Grafana before setting the grafana_dashboards_path
config). The fix for this issue is addressed in https://github.com/canonical/grafana-k8s-operator/pull/335
should be fixed by #98
Bug Description
Changing the configuration (e.g.
grafana_dashboards
) does not update the Grafana dashboard. This seems to be due to the fact that the dashboard is only updated during aninstall
orupgrade
event:https://github.com/canonical/cos-configuration-k8s-operator/blob/051e1461430edb2d342f8b2088a79d363fd02140/lib/charms/grafana_k8s/v0/grafana_dashboard.py#L1051-L1052
As a user, I would expect the dashboard data to be updated when the configuration is changed.
To Reproduce
juju deploy --trust grafana-k8s grafana
juju deploy cos-configuration-k8s --config git_repo=https://github.com/canonical/github-runner-operator --config git_branch=main
juju config cos-configuration-k8s grafana_dashboards_path=src/grafana_dashboard_metrics
juju relate cos-configuration-k8s:grafana-dashboards grafana:grafana-dashboard
juju show-unit grafana/0 --format json | jq '."grafana/0"."relation-info"'
The last command shows an empty dashboard in the integration data. It would not be empty if the configuration value
grafana_dashboards_path=src/grafana_dashboard_metric
had been passed at deployment time.Environment
Juju (tested with 3.1 and 2.9) within multipass using microk8s.
Relevant log output
Additional context
No response