Plugins: Ensure grafana cli can install multiple plugin dependencies (#91230)

* fix cli can only install one dep

* handle error
This commit is contained in:
jackyin 2024-08-01 18:47:11 +08:00 committed by GitHub
parent 796f2994f9
commit d11f8c7bc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -152,11 +152,14 @@ func doInstallPlugin(ctx context.Context, pluginID, version string, o pluginInst
for _, dep := range extractedArchive.Dependencies { for _, dep := range extractedArchive.Dependencies {
services.Logger.Infof("Fetching %s dependency %s...", pluginID, dep.ID) services.Logger.Infof("Fetching %s dependency %s...", pluginID, dep.ID)
return doInstallPlugin(ctx, dep.ID, dep.Version, pluginInstallOpts{ err = doInstallPlugin(ctx, dep.ID, dep.Version, pluginInstallOpts{
insecure: o.insecure, insecure: o.insecure,
repoURL: o.repoURL, repoURL: o.repoURL,
pluginDir: o.pluginDir, pluginDir: o.pluginDir,
}, installing) }, installing)
if err != nil {
return err
}
} }
return nil return nil
} }