Plugins: Refactor loader + finder to support multiple sourcing methods (#64735)

* it's cdn time

* tidy body closing

* auto signed

* fix close

* update log name

* remove comments
This commit is contained in:
Will Browne
2023-03-20 13:35:49 +00:00
committed by GitHub
parent eba2c7b522
commit ee2dd62a1f
25 changed files with 389 additions and 223 deletions

View File

@ -9,6 +9,7 @@ import (
"github.com/grafana/grafana/pkg/plugins/log"
"github.com/grafana/grafana/pkg/plugins/manager/loader"
"github.com/grafana/grafana/pkg/plugins/manager/registry"
"github.com/grafana/grafana/pkg/plugins/manager/sources"
"github.com/grafana/grafana/pkg/plugins/repo"
"github.com/grafana/grafana/pkg/plugins/storage"
)
@ -118,7 +119,7 @@ func (m *PluginInstaller) Add(ctx context.Context, pluginID, version string, opt
pathsToScan = append(pathsToScan, depArchive.Path)
}
_, err = m.pluginLoader.Load(ctx, plugins.External, pathsToScan)
_, err = m.pluginLoader.Load(ctx, sources.NewLocalSource(plugins.External, pathsToScan))
if err != nil {
m.log.Error("Could not load plugins", "paths", pathsToScan, "err", err)
return err