mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
* Protect against missing overrides section We are using grafonnet-lib to generate dashboards. These dashboards do not contain any `override` keys in `fieldConfig` by default and that is causing this DashboardMigrator script to blow up when trying to import the dashboards, see [1]. In Grafana v7, an empty overrides is automatically added but using grafonnet-lib, it isn't possible to set an empty overrides attribute e.g. [2] requires matcher/properties to be set. Setting to null ends up giving me [3], which causes the panel to not be displayed. [1] ``` initDashboard.ts:137 TypeError: t.overrides is not iterable at v.w (DashboardMigrator.ts:960) at v.updateSchema (DashboardMigrator.ts:672) at D.updateSchema (DashboardModel.ts:993) at new D (DashboardModel.ts:156) at initDashboard.ts:134 ``` [2] https://github.com/grafana/grafonnet-lib/blob/master/grafonnet/stat_panel.libsonnet#L150-L164 [3] ``` "fieldConfig": { "defaults": { "links": [ ], "mappings": [ ], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "orange", "value": 1 }, { "color": "green", "value": 3 } ] }, "unit": "none" }, "overrides": [ { } ] }, ``` * Update public/app/features/dashboard/state/DashboardMigrator.ts Co-authored-by: Marcus Andersson <systemvetaren@gmail.com> |
||
---|---|---|
.. | ||
app | ||
dashboards | ||
emails | ||
fonts | ||
img | ||
lib | ||
sass | ||
test | ||
testdata | ||
vendor | ||
views | ||
robots.txt |