chore: move plugins models into pluginsettings svc (#61944)

This commit is contained in:
Kristin Laemmert
2023-01-23 13:56:20 -05:00
committed by GitHub
parent 48b620231e
commit 6e9eb0d931
13 changed files with 108 additions and 177 deletions
+2 -3
View File
@@ -11,7 +11,6 @@ import (
"github.com/grafana/grafana/pkg/infra/localcache"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins/adapters"
"github.com/grafana/grafana/pkg/services/datasources"
@@ -80,9 +79,9 @@ func (p *Provider) pluginContext(ctx context.Context, pluginID string, user *use
ps, err := p.getCachedPluginSettings(ctx, pluginID, user)
if err != nil {
// models.ErrPluginSettingNotFound is expected if there's no row found for plugin setting in database (if non-app plugin).
// pluginsettings.ErrPluginSettingNotFound is expected if there's no row found for plugin setting in database (if non-app plugin).
// If it's not this expected error something is wrong with cache or database and we return the error to the client.
if !errors.Is(err, models.ErrPluginSettingNotFound) {
if !errors.Is(err, pluginsettings.ErrPluginSettingNotFound) {
return backend.PluginContext{}, false, fmt.Errorf("%v: %w", "Failed to get plugin settings", err)
}
} else {