plugins: Don't exit on duplicate plugin (#28390) (#28430)

* plugins: Don't exit on duplicate plugin

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Add missing files

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
(cherry picked from commit 4084b53f91)

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2020-10-21 13:04:25 +02:00
committed by GitHub
co-authored by Arve Knudsen
parent d18ac27126
commit 363d0a9588
8 changed files with 73 additions and 7 deletions
+6
View File
@@ -271,6 +271,12 @@ func (pm *PluginManager) scan(pluginDir string, requireSigned bool) error {
// Load the full plugin, and add it to manager
if err := loader.Load(jsonParser, plugin, scanner.backendPluginManager); err != nil {
if errors.Is(err, duplicatePluginError{}) {
pm.log.Warn("Plugin is duplicate", "error", err)
scanner.errors = append(scanner.errors, err)
continue
}
return err
}