Plugins: Fix scanning plugins when permission for directories is lacking (#44587)

Fixes so that errors (directory not exists, no permission) when scanning plugins are logged as 
errors rather than with debug level. In addition, before the scanning would halt in case of 
referenced errors, but with these changes the scanning will continue. If any other error 
than the referenced error happens the scanning for specific directory would halt and return 
the error, e.g. stop Grafana from starting.

Fixes #43012
This commit is contained in:
Marcus Efraimsson
2022-01-31 14:07:10 +01:00
committed by GitHub
parent 5a5f5cacc8
commit 333de57999
3 changed files with 75 additions and 13 deletions

View File

@ -62,7 +62,7 @@ func New(cfg *plugins.Cfg, license models.Licensing, authorizer plugins.PluginLo
func (l *Loader) Load(ctx context.Context, class plugins.Class, paths []string, ignore map[string]struct{}) ([]*plugins.Plugin, error) {
pluginJSONPaths, err := l.pluginFinder.Find(paths)
if err != nil {
l.log.Error("plugin finder encountered an error", "err", err)
return nil, err
}
return l.loadPlugins(ctx, class, pluginJSONPaths, ignore)