mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tidy up (#49720)
This commit is contained in:
parent
f5d25c91f6
commit
4fae0f49d7
@ -623,11 +623,8 @@ func (f *fakePluginInstaller) GetUpdateInfo(_ context.Context, _, _, _ string) (
|
|||||||
|
|
||||||
type fakeLoader struct {
|
type fakeLoader struct {
|
||||||
mockedLoadedPlugins []*plugins.Plugin
|
mockedLoadedPlugins []*plugins.Plugin
|
||||||
mockedFactoryLoadedPlugin *plugins.Plugin
|
|
||||||
|
|
||||||
loadedPaths []string
|
loadedPaths []string
|
||||||
|
|
||||||
plugins.Loader
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *fakeLoader) Load(_ context.Context, _ plugins.Class, paths []string, _ map[string]struct{}) ([]*plugins.Plugin, error) {
|
func (l *fakeLoader) Load(_ context.Context, _ plugins.Class, paths []string, _ map[string]struct{}) ([]*plugins.Plugin, error) {
|
||||||
@ -636,12 +633,6 @@ func (l *fakeLoader) Load(_ context.Context, _ plugins.Class, paths []string, _
|
|||||||
return l.mockedLoadedPlugins, nil
|
return l.mockedLoadedPlugins, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *fakeLoader) LoadWithFactory(_ context.Context, _ plugins.Class, path string, _ backendplugin.PluginFactoryFunc) (*plugins.Plugin, error) {
|
|
||||||
l.loadedPaths = append(l.loadedPaths, path)
|
|
||||||
|
|
||||||
return l.mockedFactoryLoadedPlugin, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type fakePluginClient struct {
|
type fakePluginClient struct {
|
||||||
pluginID string
|
pluginID string
|
||||||
logger log.Logger
|
logger log.Logger
|
||||||
|
@ -27,7 +27,7 @@ func (s *Validator) Validate(plugin *plugins.Plugin) *plugins.SignatureError {
|
|||||||
if plugin.Parent != nil {
|
if plugin.Parent != nil {
|
||||||
if plugin.IsCorePlugin() || plugin.Signature == plugins.SignatureInternal {
|
if plugin.IsCorePlugin() || plugin.Signature == plugins.SignatureInternal {
|
||||||
s.log.Debug("Not setting descendant plugin's signature to that of root since it's core or internal",
|
s.log.Debug("Not setting descendant plugin's signature to that of root since it's core or internal",
|
||||||
"plugin", plugin.ID, "signature", plugin.Signature, "isCore", plugin.IsCorePlugin)
|
"plugin", plugin.ID, "signature", plugin.Signature, "isCore", plugin.IsCorePlugin())
|
||||||
} else {
|
} else {
|
||||||
s.log.Debug("Setting descendant plugin's signature to that of root", "plugin", plugin.ID,
|
s.log.Debug("Setting descendant plugin's signature to that of root", "plugin", plugin.ID,
|
||||||
"root", plugin.Parent.ID, "signature", plugin.Signature, "rootSignature", plugin.Parent.Signature)
|
"root", plugin.Parent.ID, "signature", plugin.Signature, "rootSignature", plugin.Parent.Signature)
|
||||||
|
Loading…
Reference in New Issue
Block a user