mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 10:02:04 +08:00
Plugins: Add plugins auto update feature (#104112)
This commit is contained in:

committed by
GitHub

parent
42028a1b03
commit
43748e43bb
@ -44,11 +44,13 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/managedplugins"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginaccesscontrol"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginassets"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginchecker"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginerrs"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/plugininstaller"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
|
||||
"github.com/grafana/grafana/pkg/services/updatechecker"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/provisionedplugins"
|
||||
"github.com/grafana/grafana/pkg/services/secrets/kvstore"
|
||||
"github.com/grafana/grafana/pkg/services/updatemanager"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/web"
|
||||
@ -112,7 +114,7 @@ func Test_PluginsInstallAndUninstall(t *testing.T) {
|
||||
},
|
||||
})
|
||||
hs.managedPluginsService = managedplugins.NewNoop()
|
||||
hs.pluginPreinstall = plugininstaller.ProvidePreinstall(hs.Cfg)
|
||||
hs.pluginPreinstall = pluginchecker.ProvidePreinstall(hs.Cfg)
|
||||
|
||||
expectedIdentity := &authn.Identity{
|
||||
OrgID: tc.permissionOrg,
|
||||
@ -644,7 +646,14 @@ func Test_PluginsList_AccessControl(t *testing.T) {
|
||||
hs.pluginFileStore = filestore.ProvideService(pluginRegistry)
|
||||
hs.managedPluginsService = managedplugins.NewNoop()
|
||||
var err error
|
||||
hs.pluginsUpdateChecker, err = updatechecker.ProvidePluginsService(hs.Cfg, nil, tracing.InitializeTracerForTest())
|
||||
hs.pluginsUpdateChecker, err = updatemanager.ProvidePluginsService(
|
||||
hs.Cfg,
|
||||
hs.pluginStore,
|
||||
nil, // plugins.Installer
|
||||
tracing.InitializeTracerForTest(),
|
||||
kvstore.NewFakeFeatureToggles(t, true),
|
||||
pluginchecker.ProvideService(hs.managedPluginsService, provisionedplugins.NewNoop(), &pluginchecker.FakePluginPreinstall{}),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
@ -836,7 +845,14 @@ func Test_PluginsSettings(t *testing.T) {
|
||||
hs.pluginAssets = pluginassets.ProvideService(pCfg, pluginCDN, sig, hs.pluginStore)
|
||||
hs.pluginErrorResolver = pluginerrs.ProvideStore(errTracker)
|
||||
var err error
|
||||
hs.pluginsUpdateChecker, err = updatechecker.ProvidePluginsService(hs.Cfg, nil, tracing.InitializeTracerForTest())
|
||||
hs.pluginsUpdateChecker, err = updatemanager.ProvidePluginsService(
|
||||
hs.Cfg,
|
||||
hs.pluginStore,
|
||||
&fakes.FakePluginInstaller{},
|
||||
tracing.InitializeTracerForTest(),
|
||||
kvstore.NewFakeFeatureToggles(t, true),
|
||||
pluginchecker.ProvideService(hs.managedPluginsService, provisionedplugins.NewNoop(), &pluginchecker.FakePluginPreinstall{}),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user