Plugins: Skip install errors if dependency plugin already exists (#94710)

* skip install errors if dependency plugin already exists

* add test
This commit is contained in:
Will Browne
2024-10-15 11:35:45 +01:00
committed by GitHub
parent 284c2d6f71
commit f97f489c2c
2 changed files with 49 additions and 0 deletions
+5
View File
@@ -75,6 +75,11 @@ func (m *PluginInstaller) Add(ctx context.Context, pluginID, version string, opt
err = m.Add(ctx, dep.ID, dep.Version, opts)
if err != nil {
var dupeErr plugins.DuplicateError
if errors.As(err, &dupeErr) {
m.log.Info("Dependency already installed", "pluginId", dep.ID)
continue
}
return fmt.Errorf("%v: %w", fmt.Sprintf("failed to download plugin %s from repository", dep.ID), err)
}
}