chore : Deprecating FeatureToggles.IsEnabledGlobally (#112885)
* add deprecation on featuremgmt.IsEnabledGlobally * add nolint reason * add reasonable deprecation message * remove junk edits * add more nolints * addressing review comments * Update pkg/services/featuremgmt/models.go Co-authored-by: Dave Henderson <dave.henderson@grafana.com> --------- Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
This commit is contained in:
co-authored by
Dave Henderson
parent
4cea71ee73
commit
81683d554d
@@ -26,6 +26,7 @@ func ProvideService(
|
||||
kv kvstore.KVStore,
|
||||
cfg *setting.Cfg,
|
||||
) (Service, error) {
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
enabled := features.IsEnabledGlobally(featuremgmt.FlagManagedDualWriter) ||
|
||||
features.IsEnabledGlobally(featuremgmt.FlagProvisioning) // required for git provisioning
|
||||
|
||||
|
||||
@@ -225,6 +225,7 @@ func newGrpcConn(address string, metrics *clientMetrics, features featuremgmt.Fe
|
||||
// Create either a connection pool or a single connection.
|
||||
// The connection pool __can__ be useful when connection to
|
||||
// server side load balancers like kube-proxy.
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorageGrpcConnectionPool) {
|
||||
conn, err := newPooledConn(&poolOpts{
|
||||
initialCapacity: 3,
|
||||
|
||||
@@ -52,6 +52,7 @@ type resourceClient struct {
|
||||
}
|
||||
|
||||
func NewResourceClient(conn, indexConn grpc.ClientConnInterface, cfg *setting.Cfg, features featuremgmt.FeatureToggles, tracer trace.Tracer) (ResourceClient, error) {
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
if !features.IsEnabledGlobally(featuremgmt.FlagAppPlatformGrpcClientAuth) {
|
||||
return NewLegacyResourceClient(conn, indexConn), nil
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ func shouldMakeBackgroundCall(ctx context.Context, features featuremgmt.FeatureT
|
||||
return false, err
|
||||
}
|
||||
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
res := features != nil &&
|
||||
features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorageSearchDualReaderEnabled) &&
|
||||
!unifiedIsMainStorage &&
|
||||
|
||||
@@ -20,6 +20,7 @@ func NewSearchOptions(
|
||||
indexMetrics *resource.BleveIndexMetrics,
|
||||
ownsIndexFn func(key resource.NamespacedResource) (bool, error),
|
||||
) (resource.SearchOptions, error) {
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorageSearch) || features.IsEnabledGlobally(featuremgmt.FlagProvisioning) {
|
||||
root := cfg.IndexPath
|
||||
if root == "" {
|
||||
|
||||
@@ -99,6 +99,7 @@ func NewResourceServer(opts ServerOptions) (resource.ResourceServer, error) {
|
||||
|
||||
isHA := isHighAvailabilityEnabled(opts.Cfg.SectionWithEnvOverrides("database"),
|
||||
opts.Cfg.SectionWithEnvOverrides("resource_api"))
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
withPruner := opts.Features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorageHistoryPruner)
|
||||
|
||||
backend, err := NewBackend(BackendOptions{
|
||||
|
||||
Reference in New Issue
Block a user