Service accounts: rename feature toggle (#48037)

* refactor: renaming service-accounts to serviceAccounts

* refactor: renaming service-accounts to serviceAccounts in docs

* tests
This commit is contained in:
Eric Leijonmarck
2022-04-21 10:41:37 +01:00
committed by GitHub
parent ae8038c5c6
commit 8677552dda
9 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ var (
State: FeatureStateBeta,
},
{
Name: "service-accounts",
Name: "serviceAccounts",
Description: "support service accounts",
State: FeatureStateBeta,
},
+1 -1
View File
@@ -21,7 +21,7 @@ const (
// FlagServiceAccounts
// support service accounts
FlagServiceAccounts = "service-accounts"
FlagServiceAccounts = "serviceAccounts"
// FlagDatabaseMetrics
// Add prometheus metrics for database tables
+1 -1
View File
@@ -11,7 +11,7 @@ func TestFeatureUsageStats(t *testing.T) {
featureManagerWithAllFeatures := WithFeatures(
"trimDefaults",
"httpclientprovider_azure_auth",
"service-accounts",
"serviceAccounts",
"database_metrics",
"dashboardPreviews",
"live-config",
@@ -16,7 +16,7 @@ import (
)
var (
ServiceAccountFeatureToggleNotFound = "FeatureToggle service-accounts not found, try adding it to your custom.ini"
ServiceAccountFeatureToggleNotFound = "FeatureToggle serviceAccounts not found, try adding it to your custom.ini"
)
type ServiceAccountsService struct {
@@ -15,7 +15,7 @@ func TestProvideServiceAccount_DeleteServiceAccount(t *testing.T) {
t.Run("feature toggle present, should call store function", func(t *testing.T) {
storeMock := &tests.ServiceAccountsStoreMock{Calls: tests.Calls{}}
svc := ServiceAccountsService{
features: featuremgmt.WithFeatures("service-accounts", true),
features: featuremgmt.WithFeatures("serviceAccounts", true),
store: storeMock}
err := svc.DeleteServiceAccount(context.Background(), 1, 1)
require.NoError(t, err)
@@ -25,7 +25,7 @@ func TestProvideServiceAccount_DeleteServiceAccount(t *testing.T) {
t.Run("no feature toggle present, should not call store function", func(t *testing.T) {
svcMock := &tests.ServiceAccountsStoreMock{Calls: tests.Calls{}}
svc := ServiceAccountsService{
features: featuremgmt.WithFeatures("service-accounts", false),
features: featuremgmt.WithFeatures("serviceAccounts", false),
store: svcMock,
log: log.New("serviceaccounts-manager-test"),
}