mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 10:12:11 +08:00
Plugins: Skips existence of module.js for renderer plugins (#19318)
* Fix: Skips test for module.js for plugins of renderer type Fixes #19130 * Refactor: Changes after PR comments * Chore: Fixes go lint issue
This commit is contained in:
@ -217,7 +217,7 @@ func (scanner *PluginScanner) loadPluginJson(pluginJsonFilePath string) error {
|
||||
loader = reflect.New(reflect.TypeOf(pluginGoType)).Interface().(PluginLoader)
|
||||
|
||||
// External plugins need a module.js file for SystemJS to load
|
||||
if !strings.HasPrefix(pluginJsonFilePath, setting.StaticRootPath) {
|
||||
if !strings.HasPrefix(pluginJsonFilePath, setting.StaticRootPath) && !scanner.IsBackendOnlyPlugin(pluginCommon.Type) {
|
||||
module := filepath.Join(filepath.Dir(pluginJsonFilePath), "module.js")
|
||||
if _, err := os.Stat(module); os.IsNotExist(err) {
|
||||
plog.Warn("Plugin missing module.js",
|
||||
@ -231,6 +231,10 @@ func (scanner *PluginScanner) loadPluginJson(pluginJsonFilePath string) error {
|
||||
return loader.Load(jsonParser, currentDir)
|
||||
}
|
||||
|
||||
func (scanner *PluginScanner) IsBackendOnlyPlugin(pluginType string) bool {
|
||||
return pluginType == "renderer"
|
||||
}
|
||||
|
||||
func GetPluginMarkdown(pluginId string, name string) ([]byte, error) {
|
||||
plug, exists := Plugins[pluginId]
|
||||
if !exists {
|
||||
|
Reference in New Issue
Block a user