Plugins: Remove support for deprecated backend plugin protocol version (#34127)

* 33959: Remove support for deprecated backend plugin protocol (v1)

* 33959: Remove unused methods

* 33959: Remove some additional unused code

* 33959: Remove some additional unused code

* 33959: Remove datasource plugin wrapper with test

* 33959:Remove DefaultProtocolVersion
This commit is contained in:
idafurjes
2021-05-19 08:57:48 +02:00
committed by GitHub
parent 5042dc3b52
commit 1e8e7e34f1
10 changed files with 14 additions and 468 deletions

View File

@ -5,7 +5,6 @@ import (
"encoding/json"
"path/filepath"
pluginModel "github.com/grafana/grafana-plugin-model/go/renderer"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/plugins/backendplugin"
"github.com/grafana/grafana/pkg/plugins/backendplugin/grpcplugin"
@ -17,7 +16,6 @@ type RendererPlugin struct {
FrontendPluginBase
Executable string `json:"executable,omitempty"`
GrpcPluginV1 pluginModel.RendererPlugin
GrpcPluginV2 pluginextensionv2.RendererPlugin
backendPluginManager backendplugin.Manager
}
@ -33,8 +31,7 @@ func (r *RendererPlugin) Load(decoder *json.Decoder, base *PluginBase,
cmd := ComposePluginStartCommand("plugin_start")
fullpath := filepath.Join(base.PluginDir, cmd)
factory := grpcplugin.NewRendererPlugin(r.Id, fullpath, grpcplugin.PluginStartFuncs{
OnLegacyStart: r.onLegacyPluginStart,
OnStart: r.onPluginStart,
OnStart: r.onPluginStart,
})
if err := backendPluginManager.Register(r.Id, factory); err != nil {
return nil, errutil.Wrapf(err, "failed to register backend plugin")
@ -51,11 +48,6 @@ func (r *RendererPlugin) Start(ctx context.Context) error {
return nil
}
func (r *RendererPlugin) onLegacyPluginStart(pluginID string, client *grpcplugin.LegacyClient, logger log.Logger) error {
r.GrpcPluginV1 = client.RendererPlugin
return nil
}
func (r *RendererPlugin) onPluginStart(pluginID string, client *grpcplugin.Client, logger log.Logger) error {
r.GrpcPluginV2 = client.RendererPlugin
return nil