Preinstall: Replace auto update feature flag with a permanent one (#113586)
This commit is contained in:
@@ -1261,13 +1261,6 @@ var (
|
||||
Owner: grafanaPartnerPluginsSquad,
|
||||
Expression: "false",
|
||||
},
|
||||
{
|
||||
Name: "preinstallAutoUpdate",
|
||||
Description: "Enables automatic updates for pre-installed plugins",
|
||||
Stage: FeatureStageGeneralAvailability,
|
||||
Owner: grafanaPluginsPlatformSquad,
|
||||
Expression: "true", // enabled by default
|
||||
},
|
||||
{
|
||||
Name: "playlistsReconciler",
|
||||
Description: "Enables experimental reconciler for playlists",
|
||||
|
||||
@@ -165,7 +165,6 @@ unifiedStorageBigObjectsSupport,experimental,@grafana/search-and-storage,false,f
|
||||
timeRangeProvider,experimental,@grafana/grafana-frontend-platform,false,false,false
|
||||
timeRangePan,experimental,@grafana/dataviz-squad,false,false,true
|
||||
azureMonitorDisableLogLimit,GA,@grafana/partner-datasources,false,false,false
|
||||
preinstallAutoUpdate,GA,@grafana/plugins-platform-backend,false,false,false
|
||||
playlistsReconciler,experimental,@grafana/grafana-app-platform-squad,false,true,false
|
||||
passwordlessMagicLinkAuthentication,experimental,@grafana/identity-access-team,false,false,false
|
||||
exploreMetricsRelatedLogs,experimental,@grafana/observability-metrics,false,false,true
|
||||
|
||||
|
Generated
-4
@@ -671,10 +671,6 @@ const (
|
||||
// Disables the log limit restriction for Azure Monitor when true. The limit is enabled by default.
|
||||
FlagAzureMonitorDisableLogLimit = "azureMonitorDisableLogLimit"
|
||||
|
||||
// FlagPreinstallAutoUpdate
|
||||
// Enables automatic updates for pre-installed plugins
|
||||
FlagPreinstallAutoUpdate = "preinstallAutoUpdate"
|
||||
|
||||
// FlagPlaylistsReconciler
|
||||
// Enables experimental reconciler for playlists
|
||||
FlagPlaylistsReconciler = "playlistsReconciler"
|
||||
|
||||
@@ -3158,7 +3158,8 @@
|
||||
"metadata": {
|
||||
"name": "preinstallAutoUpdate",
|
||||
"resourceVersion": "1753448760331",
|
||||
"creationTimestamp": "2024-11-07T12:14:25Z"
|
||||
"creationTimestamp": "2024-11-07T12:14:25Z",
|
||||
"deletionTimestamp": "2025-11-07T10:10:01Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "Enables automatic updates for pre-installed plugins",
|
||||
|
||||
@@ -12,7 +12,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/pluginchecker"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
@@ -45,7 +44,6 @@ type Service struct {
|
||||
pluginInstaller plugins.Installer
|
||||
pluginStore pluginstore.Store
|
||||
pluginRepo repo.Service
|
||||
features featuremgmt.FeatureToggles
|
||||
updateChecker pluginchecker.PluginUpdateChecker
|
||||
installComplete chan struct{} // closed when all plugins are installed (used for testing)
|
||||
}
|
||||
@@ -56,7 +54,6 @@ func ProvideService(
|
||||
pluginInstaller plugins.Installer,
|
||||
promReg prometheus.Registerer,
|
||||
pluginRepo repo.Service,
|
||||
features featuremgmt.FeatureToggles,
|
||||
updateChecker pluginchecker.PluginUpdateChecker,
|
||||
) (*Service, error) {
|
||||
once.Do(func() {
|
||||
@@ -70,7 +67,6 @@ func ProvideService(
|
||||
pluginInstaller: pluginInstaller,
|
||||
pluginStore: pluginStore,
|
||||
pluginRepo: pluginRepo,
|
||||
features: features,
|
||||
updateChecker: updateChecker,
|
||||
installComplete: make(chan struct{}),
|
||||
}
|
||||
@@ -111,8 +107,8 @@ func (s *Service) installPlugins(ctx context.Context, pluginsToInstall []setting
|
||||
continue
|
||||
}
|
||||
if installPlugin.Version == "" {
|
||||
if !s.features.IsEnabled(ctx, featuremgmt.FlagPreinstallAutoUpdate) {
|
||||
// Skip updating the plugin if the feature flag is disabled
|
||||
if !s.cfg.PreinstallAutoUpdate {
|
||||
// Skip updating the plugin if auto-update is disabled
|
||||
continue
|
||||
}
|
||||
// The plugin is installed but it's not pinned to a specific version
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/pluginfakes"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/registry"
|
||||
"github.com/grafana/grafana/pkg/plugins/repo"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/installsync/installsyncfakes"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/managedplugins"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginchecker"
|
||||
@@ -31,7 +30,6 @@ func TestService_IsDisabled(t *testing.T) {
|
||||
&pluginfakes.FakePluginInstaller{},
|
||||
prometheus.NewRegistry(),
|
||||
&pluginfakes.FakePluginRepo{},
|
||||
featuremgmt.WithFeatures(),
|
||||
&pluginchecker.FakePluginUpdateChecker{},
|
||||
)
|
||||
require.NoError(t, err)
|
||||
@@ -167,6 +165,7 @@ func TestService_Run(t *testing.T) {
|
||||
&setting.Cfg{
|
||||
PreinstallPluginsAsync: tt.pluginsToInstall,
|
||||
PreinstallPluginsSync: tt.pluginsToInstallSync,
|
||||
PreinstallAutoUpdate: true,
|
||||
},
|
||||
store,
|
||||
&pluginfakes.FakePluginInstaller{
|
||||
@@ -199,7 +198,6 @@ func TestService_Run(t *testing.T) {
|
||||
return tt.latestPlugin, nil
|
||||
},
|
||||
},
|
||||
featuremgmt.WithFeatures(featuremgmt.FlagPreinstallAutoUpdate),
|
||||
pluginchecker.ProvideService(
|
||||
managedplugins.NewNoop(),
|
||||
provisionedplugins.NewNoop(),
|
||||
|
||||
Reference in New Issue
Block a user