Skip to content

Commit b60dbbe

Browse files
committed
Do not create dashboards provisioning config if there are no dashboards
If there is no dashboards, then no /grafana-dashboard-definitions/0/ is created and Grafana becomes upset, because it's provisioning config points there.
1 parent ba95ada commit b60dbbe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

grafana/grafana.libsonnet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ local configMapList = k.core.v1.configMapList;
114114
[
115115
storageVolumeMount,
116116
datasourcesVolumeMount,
117-
dashboardsVolumeMount,
118117
] +
118+
if std.length(self.dashboardDefinitions.items) > 0 then [dashboardsVolumeMount] else [] +
119119
[
120120
local dashboardName = std.strReplace(name, '.json', '');
121121
containerVolumeMount.new('grafana-dashboard-' + dashboardName, '/grafana-dashboard-definitions/0/' + dashboardName)
@@ -127,8 +127,8 @@ local configMapList = k.core.v1.configMapList;
127127
[
128128
storageVolume,
129129
datasourcesVolume,
130-
dashboardsVolume,
131130
] +
131+
if std.length(self.dashboardDefinitions.items) > 0 then [dashboardsVolume] else [] +
132132
[
133133
local dashboardName = 'grafana-dashboard-' + std.strReplace(name, '.json', '');
134134
volume.withName(dashboardName) +

0 commit comments

Comments
 (0)