mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 07:22:13 +08:00
Plugins: Add logs to for plugin management actions (#90587)
* Plugins: Add logs to for plugin management actions --------- Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
This commit is contained in:

committed by
GitHub

parent
08c611c68b
commit
5c966fd400
@ -456,6 +456,8 @@ func (hs *HTTPServer) InstallPlugin(c *contextmodel.ReqContext) response.Respons
|
||||
}
|
||||
pluginID := web.Params(c.Req)[":pluginId"]
|
||||
|
||||
hs.log.Info("Plugin install/update requested", "pluginId", pluginID, "user", c.Login)
|
||||
|
||||
compatOpts := plugins.NewCompatOpts(hs.Cfg.BuildVersion, runtime.GOOS, runtime.GOARCH)
|
||||
err := hs.pluginInstaller.Add(c.Req.Context(), pluginID, dto.Version, compatOpts)
|
||||
if err != nil {
|
||||
@ -486,6 +488,9 @@ func (hs *HTTPServer) InstallPlugin(c *contextmodel.ReqContext) response.Respons
|
||||
|
||||
func (hs *HTTPServer) UninstallPlugin(c *contextmodel.ReqContext) response.Response {
|
||||
pluginID := web.Params(c.Req)[":pluginId"]
|
||||
|
||||
hs.log.Info("Plugin uninstall requested", "pluginId", pluginID, "user", c.Login)
|
||||
|
||||
plugin, exists := hs.pluginStore.Plugin(c.Req.Context(), pluginID)
|
||||
if !exists {
|
||||
return response.Error(http.StatusNotFound, "Plugin not installed", nil)
|
||||
|
Reference in New Issue
Block a user