[v11.2.x] Plugins: Skip install errors if dependency plugin already exists (#94717)
Plugins: Skip install errors if dependency plugin already exists (#94710)
* skip install errors if dependency plugin already exists
* add test
(cherry picked from commit f97f489c2c)
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
co-authored by
Will Browne
parent
da025b1bd3
commit
3965e68c8d
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user