Cloudwatch: Deprecate cloudwatchNewRegionsHandler feature toggle and remove core imports from featuremgmt (#81310)
* Remove core imports from grafana/pkg/services/featuremgmt in CloudWatch
This commit is contained in:
@@ -2,6 +2,7 @@ package cloudwatch
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
@@ -16,6 +17,7 @@ import (
|
||||
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/resourcegroupstaggingapiiface"
|
||||
"github.com/grafana/grafana-aws-sdk/pkg/awsds"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/experimental/featuretoggles"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
@@ -270,3 +272,9 @@ func (e fakeAWSError) Code() string {
|
||||
func (e fakeAWSError) Message() string {
|
||||
return e.message
|
||||
}
|
||||
|
||||
func contextWithFeaturesEnabled(enabled ...string) context.Context {
|
||||
featureString := strings.Join(enabled, ",")
|
||||
cfg := backend.NewGrafanaCfg(map[string]string{featuretoggles.EnabledFeatures: featureString})
|
||||
return backend.WithGrafanaConfig(context.Background(), cfg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user