From dbbc40af79338b438e08fa94aa13f6ffbaa85616 Mon Sep 17 00:00:00 2001 From: Samuel Recker Date: Fri, 17 Dec 2021 12:53:45 +0100 Subject: [PATCH 1/3] add manual specification of mounts --- grafana/grafana.libsonnet | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grafana/grafana.libsonnet b/grafana/grafana.libsonnet index 166448a..f42304f 100644 --- a/grafana/grafana.libsonnet +++ b/grafana/grafana.libsonnet @@ -202,15 +202,15 @@ function(params) { readOnly: false, }; - local storageVolume = { + local storageVolume = std.get(g._config, storageVolume, default={ name: 'grafana-storage', emptyDir: {}, - }; - local storageVolumeMount = { + }); + local storageVolumeMount = std.get(g._config, storageVolumeMount, default={ name: storageVolume.name, mountPath: '/var/lib/grafana', readOnly: false, - }; + }); local datasourcesVolume = { name: 'grafana-datasources', From 1cb6c6049f7bda1375da39a80a756c0188142f8d Mon Sep 17 00:00:00 2001 From: Samuel Recker Date: Fri, 17 Dec 2021 15:32:52 +0100 Subject: [PATCH 2/3] also allow hidden fields --- grafana/grafana.libsonnet | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grafana/grafana.libsonnet b/grafana/grafana.libsonnet index f42304f..de6812d 100644 --- a/grafana/grafana.libsonnet +++ b/grafana/grafana.libsonnet @@ -202,15 +202,15 @@ function(params) { readOnly: false, }; - local storageVolume = std.get(g._config, storageVolume, default={ + local storageVolume = if std.objectHasAll(g._config, 'storageVolume') then g._config.storageVolume else { name: 'grafana-storage', emptyDir: {}, - }); - local storageVolumeMount = std.get(g._config, storageVolumeMount, default={ + }; + local storageVolumeMount = if std.objectHasAll(g._config, 'storageVolumeMount') then g._config.storageVolumeMount else { name: storageVolume.name, mountPath: '/var/lib/grafana', readOnly: false, - }); + }; local datasourcesVolume = { name: 'grafana-datasources', From f8b1cb408ed89dda27d209da76e4d2cc94b11597 Mon Sep 17 00:00:00 2001 From: Samuel Recker Date: Tue, 18 Jan 2022 12:09:08 +0100 Subject: [PATCH 3/3] std.get is not official yet,change to old access --- grafana/grafana.libsonnet | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/grafana/grafana.libsonnet b/grafana/grafana.libsonnet index de6812d..472a859 100644 --- a/grafana/grafana.libsonnet +++ b/grafana/grafana.libsonnet @@ -202,11 +202,15 @@ function(params) { readOnly: false, }; - local storageVolume = if std.objectHasAll(g._config, 'storageVolume') then g._config.storageVolume else { + local storageVolume = if std.objectHasAll(g._config, 'storageVolume') + then g._config.storageVolume + else { name: 'grafana-storage', emptyDir: {}, }; - local storageVolumeMount = if std.objectHasAll(g._config, 'storageVolumeMount') then g._config.storageVolumeMount else { + local storageVolumeMount = if std.objectHasAll(g._config, 'storageVolumeMount') + then g._config.storageVolumeMount + else { name: storageVolume.name, mountPath: '/var/lib/grafana', readOnly: false,