mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 02:12:24 +08:00
Chore: Remove plugincontext.ErrPluginNotFound (#74997)
This commit is contained in:

committed by
GitHub

parent
1714fa598c
commit
ece94b1e01
@ -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)
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user