mirror of
https://github.com/grafana/grafana.git
synced 2025-01-13 09:32:12 -06:00
Remove backgroundPluginInstaller feature flag (#93540)
This commit is contained in:
parent
07f11e9222
commit
a45167a595
@ -1732,7 +1732,7 @@ install_token =
|
||||
hide_angular_deprecation =
|
||||
# Comma separated list of plugin ids for which environment variables should be forwarded. Used only when feature flag pluginsSkipHostEnvVars is enabled.
|
||||
forward_host_env_vars =
|
||||
# Comma separated list of plugin ids to install as part of the startup process. Used only when feature flag backgroundPluginInstaller is enabled.
|
||||
# Comma separated list of plugin ids to install as part of the startup process.
|
||||
preinstall =
|
||||
# Controls whether preinstall plugins asynchronously (in the background) or synchronously (blocking). Useful when preinstalled plugins are used with provisioning.
|
||||
preinstall_async = true
|
||||
|
@ -194,7 +194,6 @@ Experimental features might be changed or removed without prior notice.
|
||||
| `databaseReadReplica` | Use a read replica for some database queries. |
|
||||
| `alertingApiServer` | Register Alerting APIs with the K8s API server |
|
||||
| `dashboardRestoreUI` | Enables the frontend to be able to restore a recently deleted dashboard |
|
||||
| `backgroundPluginInstaller` | Enable background plugin installer |
|
||||
| `dataplaneAggregator` | Enable grafana dataplane aggregator |
|
||||
| `newFiltersUI` | Enables new combobox style UI for the Ad hoc filters variable in scenes architecture |
|
||||
| `lokiSendDashboardPanelNames` | Send dashboard and panel names to Loki when querying |
|
||||
|
@ -203,7 +203,6 @@ export interface FeatureToggles {
|
||||
cloudwatchMetricInsightsCrossAccount?: boolean;
|
||||
prometheusAzureOverrideAudience?: boolean;
|
||||
alertingFilterV2?: boolean;
|
||||
backgroundPluginInstaller?: boolean;
|
||||
dataplaneAggregator?: boolean;
|
||||
newFiltersUI?: boolean;
|
||||
lokiSendDashboardPanelNames?: boolean;
|
||||
|
@ -1402,13 +1402,6 @@ var (
|
||||
Owner: grafanaAlertingSquad,
|
||||
HideFromDocs: true,
|
||||
},
|
||||
{
|
||||
Name: "backgroundPluginInstaller",
|
||||
Description: "Enable background plugin installer",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaPluginsPlatformSquad,
|
||||
RequiresRestart: true,
|
||||
},
|
||||
{
|
||||
Name: "dataplaneAggregator",
|
||||
Description: "Enable grafana dataplane aggregator",
|
||||
|
@ -184,7 +184,6 @@ bodyScrolling,preview,@grafana/grafana-frontend-platform,false,false,true
|
||||
cloudwatchMetricInsightsCrossAccount,preview,@grafana/aws-datasources,false,false,true
|
||||
prometheusAzureOverrideAudience,deprecated,@grafana/partner-datasources,false,false,false
|
||||
alertingFilterV2,experimental,@grafana/alerting-squad,false,false,false
|
||||
backgroundPluginInstaller,experimental,@grafana/plugins-platform-backend,false,true,false
|
||||
dataplaneAggregator,experimental,@grafana/grafana-app-platform-squad,false,true,false
|
||||
newFiltersUI,experimental,@grafana/dashboards-squad,false,false,false
|
||||
lokiSendDashboardPanelNames,experimental,@grafana/observability-logs,false,false,false
|
||||
|
|
@ -747,10 +747,6 @@ const (
|
||||
// Enable the new alerting search experience
|
||||
FlagAlertingFilterV2 = "alertingFilterV2"
|
||||
|
||||
// FlagBackgroundPluginInstaller
|
||||
// Enable background plugin installer
|
||||
FlagBackgroundPluginInstaller = "backgroundPluginInstaller"
|
||||
|
||||
// FlagDataplaneAggregator
|
||||
// Enable grafana dataplane aggregator
|
||||
FlagDataplaneAggregator = "dataplaneAggregator"
|
||||
|
@ -580,7 +580,8 @@
|
||||
"metadata": {
|
||||
"name": "backgroundPluginInstaller",
|
||||
"resourceVersion": "1723202510081",
|
||||
"creationTimestamp": "2024-08-09T11:21:50Z"
|
||||
"creationTimestamp": "2024-08-09T11:21:50Z",
|
||||
"deletionTimestamp": "2024-09-20T13:20:41Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "Enable background plugin installer",
|
||||
|
@ -11,7 +11,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/repo"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
@ -36,21 +35,19 @@ var (
|
||||
|
||||
type Service struct {
|
||||
cfg *setting.Cfg
|
||||
features featuremgmt.FeatureToggles
|
||||
log log.Logger
|
||||
pluginInstaller plugins.Installer
|
||||
pluginStore pluginstore.Store
|
||||
failOnErr bool
|
||||
}
|
||||
|
||||
func ProvideService(cfg *setting.Cfg, features featuremgmt.FeatureToggles, pluginStore pluginstore.Store, pluginInstaller plugins.Installer, promReg prometheus.Registerer) (*Service, error) {
|
||||
func ProvideService(cfg *setting.Cfg, pluginStore pluginstore.Store, pluginInstaller plugins.Installer, promReg prometheus.Registerer) (*Service, error) {
|
||||
once.Do(func() {
|
||||
promReg.MustRegister(installRequestCounter)
|
||||
promReg.MustRegister(installRequestDuration)
|
||||
})
|
||||
|
||||
s := &Service{
|
||||
features: features,
|
||||
log: log.New("plugin.backgroundinstaller"),
|
||||
cfg: cfg,
|
||||
pluginInstaller: pluginInstaller,
|
||||
@ -69,8 +66,7 @@ func ProvideService(cfg *setting.Cfg, features featuremgmt.FeatureToggles, plugi
|
||||
|
||||
// IsDisabled disables background installation of plugins.
|
||||
func (s *Service) IsDisabled() bool {
|
||||
return !s.features.IsEnabled(context.Background(), featuremgmt.FlagBackgroundPluginInstaller) ||
|
||||
len(s.cfg.PreinstallPlugins) == 0 ||
|
||||
return len(s.cfg.PreinstallPlugins) == 0 ||
|
||||
!s.cfg.PreinstallPluginsAsync
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/fakes"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/registry"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
@ -22,7 +21,6 @@ func TestService_IsDisabled(t *testing.T) {
|
||||
PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin"}},
|
||||
PreinstallPluginsAsync: true,
|
||||
},
|
||||
featuremgmt.WithFeatures(featuremgmt.FlagBackgroundPluginInstaller),
|
||||
pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}),
|
||||
&fakes.FakePluginInstaller{},
|
||||
prometheus.NewRegistry(),
|
||||
@ -42,7 +40,6 @@ func TestService_Run(t *testing.T) {
|
||||
&setting.Cfg{
|
||||
PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin"}},
|
||||
},
|
||||
featuremgmt.WithFeatures(),
|
||||
pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}),
|
||||
&fakes.FakePluginInstaller{
|
||||
AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error {
|
||||
@ -66,7 +63,6 @@ func TestService_Run(t *testing.T) {
|
||||
PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin", Version: "1.0.0"}},
|
||||
PreinstallPluginsAsync: true,
|
||||
},
|
||||
featuremgmt.WithFeatures(),
|
||||
pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}),
|
||||
&fakes.FakePluginInstaller{
|
||||
AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error {
|
||||
@ -98,7 +94,6 @@ func TestService_Run(t *testing.T) {
|
||||
PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin"}},
|
||||
PreinstallPluginsAsync: true,
|
||||
},
|
||||
featuremgmt.WithFeatures(),
|
||||
pluginstore.New(preg, &fakes.FakeLoader{}),
|
||||
&fakes.FakePluginInstaller{
|
||||
AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error {
|
||||
@ -131,7 +126,6 @@ func TestService_Run(t *testing.T) {
|
||||
PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin", Version: "2.0.0"}},
|
||||
PreinstallPluginsAsync: true,
|
||||
},
|
||||
featuremgmt.WithFeatures(),
|
||||
pluginstore.New(preg, &fakes.FakeLoader{}),
|
||||
&fakes.FakePluginInstaller{
|
||||
AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error {
|
||||
@ -155,7 +149,6 @@ func TestService_Run(t *testing.T) {
|
||||
PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin1"}, {ID: "myplugin2"}},
|
||||
PreinstallPluginsAsync: true,
|
||||
},
|
||||
featuremgmt.WithFeatures(),
|
||||
pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}),
|
||||
&fakes.FakePluginInstaller{
|
||||
AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error {
|
||||
@ -179,7 +172,6 @@ func TestService_Run(t *testing.T) {
|
||||
PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin1"}, {ID: "myplugin2"}},
|
||||
PreinstallPluginsAsync: true,
|
||||
},
|
||||
featuremgmt.WithFeatures(),
|
||||
pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}),
|
||||
&fakes.FakePluginInstaller{
|
||||
AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error {
|
||||
@ -205,7 +197,6 @@ func TestService_Run(t *testing.T) {
|
||||
PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin"}},
|
||||
PreinstallPluginsAsync: false,
|
||||
},
|
||||
featuremgmt.WithFeatures(),
|
||||
pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}),
|
||||
&fakes.FakePluginInstaller{
|
||||
AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error {
|
||||
@ -225,7 +216,6 @@ func TestService_Run(t *testing.T) {
|
||||
PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin"}},
|
||||
PreinstallPluginsAsync: false,
|
||||
},
|
||||
featuremgmt.WithFeatures(),
|
||||
pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}),
|
||||
&fakes.FakePluginInstaller{
|
||||
AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error {
|
||||
|
Loading…
Reference in New Issue
Block a user