Plugins: Use grafana-plugin-sdk-go v0.5.0 (#21116)
* fix dispense * plugin loading refactor Moves common functionality of registering, starting, stopping and restarting backend plugins to backendplugin package. * simplify plugin descriptors * target sdk v0.5.0 Co-authored-by: Kyle Brandt <kyle@kbrandt.com>
This commit is contained in:
committed by
Kyle Brandt
co-authored by
Kyle Brandt
parent
5321e7536f
commit
baba1634b8
@@ -7,9 +7,6 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
plugin "github.com/hashicorp/go-plugin"
|
||||
|
||||
pluginModel "github.com/grafana/grafana-plugin-model/go/renderer"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/middleware"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
@@ -25,8 +22,6 @@ func init() {
|
||||
|
||||
type RenderingService struct {
|
||||
log log.Logger
|
||||
pluginClient *plugin.Client
|
||||
grpcPlugin pluginModel.RendererPlugin
|
||||
pluginInfo *plugins.RendererPlugin
|
||||
renderAction renderFunc
|
||||
domain string
|
||||
@@ -85,15 +80,8 @@ func (rs *RenderingService) Run(ctx context.Context) error {
|
||||
}
|
||||
|
||||
rs.renderAction = rs.renderViaPlugin
|
||||
|
||||
err := rs.watchAndRestartPlugin(ctx)
|
||||
|
||||
if rs.pluginClient != nil {
|
||||
rs.log.Debug("Killing renderer plugin process")
|
||||
rs.pluginClient.Kill()
|
||||
}
|
||||
|
||||
return err
|
||||
<-ctx.Done()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (rs *RenderingService) RenderErrorImage(err error) (*RenderResult, error) {
|
||||
|
||||
Reference in New Issue
Block a user