mirror of
https://github.com/grafana/grafana.git
synced 2025-09-22 16:03:09 +08:00
add core plugins thru store (#43085)
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user