Alerting: Allow querying of Alerts from notifications (#32614)

* Alerting: Allow querying of Alerts from notifications

* Wire everything up

* Remove unused functions

* Remove duplicate line
This commit is contained in:
gotjosh
2021-04-08 12:27:59 +01:00
committed by GitHub
parent 2f3ef69b30
commit fe67680c42
11 changed files with 425 additions and 226 deletions
+9 -1
View File
@@ -7,6 +7,7 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
"testing"
"github.com/grafana/grafana/pkg/infra/fs"
@@ -195,6 +196,12 @@ func CreateGrafDir(t *testing.T, opts ...GrafanaOpts) (string, string) {
_, err = securitySect.NewKey("content_security_policy", "true")
require.NoError(t, err)
}
if len(o.EnableFeatureToggles) > 0 {
featureSection, err := cfg.NewSection("feature_toggles")
require.NoError(t, err)
_, err = featureSection.NewKey("enable", strings.Join(o.EnableFeatureToggles, " "))
require.NoError(t, err)
}
}
cfgPath := filepath.Join(cfgDir, "test.ini")
@@ -208,5 +215,6 @@ func CreateGrafDir(t *testing.T, opts ...GrafanaOpts) (string, string) {
}
type GrafanaOpts struct {
EnableCSP bool
EnableCSP bool
EnableFeatureToggles []string
}