add core plugins thru store (#43085)

This commit is contained in:
Will Browne
2021-12-14 14:22:40 +00:00
committed by GitHub
parent 5d18834deb
commit e4ba5f17dd
23 changed files with 139 additions and 95 deletions

View File

@ -2,8 +2,11 @@ package plugins
import (
"fmt"
"path/filepath"
"runtime"
"strings"
"github.com/grafana/grafana/pkg/setting"
)
func ComposePluginStartCommand(executable string) string {
@ -29,3 +32,14 @@ func ComposeRendererStartCommand() string {
return fmt.Sprintf("%s_%s_%s%s", "plugin_start", os, strings.ToLower(arch), extension)
}
func CoreDataSourcePathResolver(cfg *setting.Cfg, pluginRootDirName string) PluginPathResolver {
return func() (string, error) {
// override mismatch cloud monitoring plugin
if pluginRootDirName == "stackdriver" {
pluginRootDirName = "cloud-monitoring"
}
return filepath.Join(cfg.StaticRootPath, "app/plugins/datasource", pluginRootDirName), nil
}
}