Chore: Remove plugincontext.ErrPluginNotFound (#74997)

This commit is contained in:
Andres Martinez Gotor
2023-09-25 12:10:47 +02:00
committed by GitHub
parent 1714fa598c
commit ece94b1e01
9 changed files with 18 additions and 32 deletions

View File

@ -15,8 +15,8 @@ import (
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/expr/mathexp"
"github.com/grafana/grafana/pkg/expr/ml"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins/httpresponsesender"
"github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext"
)
var (
@ -64,7 +64,7 @@ func (m *MLNode) Execute(ctx context.Context, now time.Time, _ mathexp.Vars, s *
// get the plugin configuration that will be used by client (auth, host, etc)
pCtx, err := s.pCtxProvider.Get(ctx, mlPluginID, m.request.User, m.request.OrgId)
if err != nil {
if errors.Is(err, plugincontext.ErrPluginNotFound) {
if errors.Is(err, plugins.ErrPluginNotRegistered) {
return result, errMLPluginDoesNotExist
}
return result, fmt.Errorf("failed to get plugin settings: %w", err)

View File

@ -13,7 +13,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/expr/ml"
"github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/services/user"
)
@ -139,7 +139,7 @@ func TestMLNodeExecute(t *testing.T) {
cfg: nil,
dataService: nil,
pCtxProvider: &fakePluginContextProvider{
errorResult: plugincontext.ErrPluginNotFound,
errorResult: plugins.ErrPluginNotRegistered,
},
features: nil,
pluginsClient: nil,