Chore: Making the plugin install commands respect the config parameter (#86578)

Currently the grafana cli plugin commands are not reacting to the --config parameter. This PR make it possible to use config to define the plugin endpoints via config as an alternative to providing the --repo flag.
This commit is contained in:
Timur Olzhabayev
2024-04-22 10:29:25 +02:00
committed by GitHub
parent 2a39f1f7ce
commit 951916c668
3 changed files with 103 additions and 0 deletions
+8
View File
@@ -376,6 +376,13 @@ func CreateGrafDir(t *testing.T, opts ...GrafanaOpts) (string, string) {
_, err = unifiedAlertingSection.NewKey("min_interval", o.NGAlertSchedulerBaseInterval.String())
require.NoError(t, err)
}
if o.GrafanaComAPIURL != "" {
grafanaComSection, err := getOrCreateSection("grafana_com")
require.NoError(t, err)
_, err = grafanaComSection.NewKey("api_url", o.GrafanaComAPIURL)
require.NoError(t, err)
}
}
logSection, err := getOrCreateSection("database")
require.NoError(t, err)
@@ -422,6 +429,7 @@ type GrafanaOpts struct {
GRPCServerAddress string
QueryRetries int64
APIServerStorageType string
GrafanaComAPIURL string
}
func CreateUser(t *testing.T, store db.DB, cfg *setting.Cfg, cmd user.CreateUserCommand) *user.User {