mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 12:32:17 +08:00
Backend Plugins: Plugin configuration using Grafana config (#23451)
Enables adding a section `plugin.<plugin id>` and key/value to Grafana configuration file which will be converted and sent as environment variables to the backend plugin. Also sends some additional environment variables, Grafana version (GF_VERSION), Grafana edition (GF_EDITION) and enterprise license path (GF_ENTERPRISE_LICENSE_PATH). Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Fixes #21515,
This commit is contained in:

committed by
GitHub

parent
941cd59894
commit
34266cd369
@ -32,18 +32,17 @@ func TestPluginScans(t *testing.T) {
|
||||
})
|
||||
|
||||
Convey("When reading app plugin definition", t, func() {
|
||||
setting.Raw = ini.Empty()
|
||||
sec, err := setting.Raw.NewSection("plugin.nginx-app")
|
||||
So(err, ShouldBeNil)
|
||||
_, err = sec.NewKey("path", "testdata/test-app")
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
pm := &PluginManager{
|
||||
Cfg: &setting.Cfg{
|
||||
FeatureToggles: map[string]bool{},
|
||||
PluginSettings: setting.PluginSettings{
|
||||
"nginx-app": map[string]string{
|
||||
"path": "testdata/test-app",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
err = pm.Init()
|
||||
err := pm.Init()
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
So(len(Apps), ShouldBeGreaterThan, 0)
|
||||
|
Reference in New Issue
Block a user