Add support for synchronous plugin installation (#92129)

This commit is contained in:
Andres Martinez Gotor
2024-08-21 16:11:55 +02:00
committed by GitHub
parent 801f2ba728
commit 21bf013a8e
7 changed files with 125 additions and 30 deletions

View File

@ -458,7 +458,7 @@ func (hs *HTTPServer) InstallPlugin(c *contextmodel.ReqContext) response.Respons
hs.log.Info("Plugin install/update requested", "pluginId", pluginID, "user", c.Login)
for _, preinstalled := range hs.Cfg.InstallPlugins {
for _, preinstalled := range hs.Cfg.PreinstallPlugins {
if preinstalled.ID == pluginID && preinstalled.Version != "" {
return response.Error(http.StatusConflict, "Cannot update a pinned pre-installed plugin", nil)
}
@ -502,7 +502,7 @@ func (hs *HTTPServer) UninstallPlugin(c *contextmodel.ReqContext) response.Respo
return response.Error(http.StatusNotFound, "Plugin not installed", nil)
}
for _, preinstalled := range hs.Cfg.InstallPlugins {
for _, preinstalled := range hs.Cfg.PreinstallPlugins {
if preinstalled.ID == pluginID {
return response.Error(http.StatusConflict, "Cannot uninstall a pre-installed plugin", nil)
}