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:
Marcus Efraimsson
2020-04-14 18:04:27 +02:00
committed by GitHub
co-authored by Arve Knudsen
parent 941cd59894
commit 34266cd369
11 changed files with 207 additions and 36 deletions
+6 -7
View File
@@ -8,22 +8,21 @@ import (
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/setting"
. "github.com/smartystreets/goconvey/convey"
"gopkg.in/ini.v1"
)
func TestPluginDashboards(t *testing.T) {
Convey("When asking plugin dashboard info", t, func() {
setting.Raw = ini.Empty()
sec, _ := setting.Raw.NewSection("plugin.test-app")
_, err := sec.NewKey("path", "testdata/test-app")
So(err, ShouldBeNil)
pm := &PluginManager{
Cfg: &setting.Cfg{
FeatureToggles: map[string]bool{},
PluginSettings: setting.PluginSettings{
"test-app": map[string]string{
"path": "testdata/test-app",
},
},
},
}
err = pm.Init()
err := pm.Init()
So(err, ShouldBeNil)
bus.AddHandler("test", func(query *models.GetDashboardQuery) error {