Provisioning: Interpolate env vars in provisioning files (#16499)

* Add value types with custom unmarshalling logic

* Add env support for notifications config

* Use env vars in json data tests for values

* Add some more complexities to value tests

* Update comment with example usage

* Set env directly in the tests, removing patching

* Update documentation

* Add env var to the file reader tests

* Add raw value

* Post merge fixes

* Add comment
This commit is contained in:
Andrej Ocenas
2019-04-24 15:39:47 +02:00
committed by GitHub
parent eb8af01a8a
commit fcebd713a5
14 changed files with 598 additions and 141 deletions
@@ -1,6 +1,7 @@
package dashboards
import (
"os"
"testing"
"github.com/grafana/grafana/pkg/log"
@@ -18,8 +19,10 @@ func TestDashboardsAsConfig(t *testing.T) {
logger := log.New("test-logger")
Convey("Can read config file version 1 format", func() {
_ = os.Setenv("TEST_VAR", "general")
cfgProvider := configReader{path: simpleDashboardConfig, log: logger}
cfg, err := cfgProvider.readConfig()
_ = os.Unsetenv("TEST_VAR")
So(err, ShouldBeNil)
validateDashboardAsConfig(t, cfg)