canonical / cos-configuration-k8s-operator

This charmed operator for Kubernetes enables you to provide configurations to various components of the Canonical Observability Stack (COS) bundle.
https://charmhub.io/cos-configuration-k8s
Apache License 2.0
4 stars 6 forks source link

Be sure to reinit dashboards without topology dropdowns #30

Closed sed-i closed 1 year ago

sed-i commented 1 year ago

Issue

28 started using the inject_dropdowns=False kwarg for grafana, but unfortunately it is called only if there is a change in the git repo hash. This means that the dashboards are not reinitialized after startup. This PR takes that into consideration, and makes sure dashboards are reinit'ed even if the hash is the same, but only once.

Solution

Add another key to the (peer relation) "stored" state. Fixes #27 (for real this time 🤞 ).

Testing Instructions

Deploy load test and refresh from path with this revision. Dashboard shouldn't have topology dropdown.

Release Notes

Be sure to reinit dashboards without topology dropdowns.

sed-i commented 1 year ago

Itest will fail because the itest points cos-config at the main branch:

https://github.com/canonical/cos-configuration-k8s-operator/blob/3b2efb37b85458c436a70e6a602c7bf52f425b31/tests/integration/test_grafana_dashboards.py#L66

Which has an outdated dashboard file.

Tested manually and confirmed it works.