mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 04:31:36 +08:00
Plugins: Do not fail bootstrap stage if single decorate step fails (#73147)
* don't fail all if decorate step fails * fix casing * include err too * cover pluginsintegration too
This commit is contained in:
@ -69,14 +69,22 @@ func (b *Bootstrap) Bootstrap(ctx context.Context, src plugins.PluginSource, fou
|
||||
return ps, nil
|
||||
}
|
||||
|
||||
bootstrappedPlugins := make([]*plugins.Plugin, 0, len(ps))
|
||||
for _, p := range ps {
|
||||
for _, decorator := range b.decorateSteps {
|
||||
p, err = decorator(ctx, p)
|
||||
var ip *plugins.Plugin
|
||||
stepFailed := false
|
||||
for _, decorate := range b.decorateSteps {
|
||||
ip, err = decorate(ctx, p)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
stepFailed = true
|
||||
b.log.Error("Could not decorate plugin", "pluginId", p.ID, "error", err)
|
||||
break
|
||||
}
|
||||
}
|
||||
if !stepFailed {
|
||||
bootstrappedPlugins = append(bootstrappedPlugins, ip)
|
||||
}
|
||||
}
|
||||
|
||||
return ps, nil
|
||||
return bootstrappedPlugins, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user