diff --git a/docs/sources/administration/service-accounts/add-service-account-token.md b/docs/sources/administration/service-accounts/add-service-account-token.md index a44a1a8d0db..49aaeb2153d 100644 --- a/docs/sources/administration/service-accounts/add-service-account-token.md +++ b/docs/sources/administration/service-accounts/add-service-account-token.md @@ -14,7 +14,7 @@ You can create a service account token using the Grafana UI or via the API. For ## Before you begin -- Ensure you have added the `service-accounts` feature toggle to Grafana. For more information about adding the `service-accounts` feature toggle, refer to [Enable service accounts]({{< relref "./enable-service-accounts.md#">}}). +- Ensure you have added the `serviceAccounts` feature toggle to Grafana. For more information about adding the feature toggle, refer to [Enable service accounts]({{< relref "./enable-service-accounts.md#">}}). - Ensure you have permission to create and edit service accounts. For more information about user roles, refer to [About users and permissions]({{< relref "../manage-users-and-permissions/about-users-and-permissions.md#">}}). - [Create a service account in Grafana]({{< relref "./create-service-account.md#">}}). diff --git a/docs/sources/administration/service-accounts/create-service-account.md b/docs/sources/administration/service-accounts/create-service-account.md index bc2909967ba..0d2a7a1b2b1 100644 --- a/docs/sources/administration/service-accounts/create-service-account.md +++ b/docs/sources/administration/service-accounts/create-service-account.md @@ -15,7 +15,7 @@ For more information about creating service accounts via the API, refer to [Crea ## Before you begin -- Ensure you have added the feature toggle for service accounts `service-accounts`. For more information about adding the `service-account` feature toggle, refer to [Enable service accounts]({{< relref "./enable-service-accounts.md#">}}). +- Ensure you have added the feature toggle for service accounts `serviceAccounts`. For more information about adding the feature toggle, refer to [Enable service accounts]({{< relref "./enable-service-accounts.md#">}}). - Ensure you have permission to create and edit service accounts. For more information about user permissions, refer to [About users and permissions]({{< relref "../manage-users-and-permissions/about-users-and-permissions.md#">}}). **To create a service account:** diff --git a/docs/sources/administration/service-accounts/enable-service-accounts.md b/docs/sources/administration/service-accounts/enable-service-accounts.md index 63d66210939..b9e1588f690 100644 --- a/docs/sources/administration/service-accounts/enable-service-accounts.md +++ b/docs/sources/administration/service-accounts/enable-service-accounts.md @@ -22,12 +22,12 @@ You can enable service accounts by: This topic shows you how to enable service accounts by modifying the Grafana configuration file. 1. Sign in to the Grafana server and locate the configuration file. For more information about finding the configuration file, refer to LINK. -1. Open the configuration file and locate the [feature toggles] section. In your [config file]({{< relref "../../administration/configuration.md#config-file-locations" >}}), add `service-accounts` as a [feature_toggle]({{< relref "../../administration/configuration.md#feature_toggle" >}}). +1. Open the configuration file and locate the [feature toggles] section. In your [config file]({{< relref "../../administration/configuration.md#config-file-locations" >}}), add `serviceAccounts` as a [feature_toggle]({{< relref "../../administration/configuration.md#feature_toggle" >}}). ``` [feature_toggles] # enable features, separated by spaces -enable = service-accounts +enable = serviceAccounts ``` 1. Save your changes, Grafana should recognize your changes; in case of any issues we recommend restarting the Grafana server. @@ -38,6 +38,6 @@ This topic shows you how to enable service accounts by setting environment varia > **Note:** Environment variables override any configuration file settings. -You can use `GF_FEATURE_TOGGLES_ENABLE = service-accounts` environment variable. +You can use `GF_FEATURE_TOGGLES_ENABLE = serviceAccounts` environment variable. For more information regarding on how to setup environment variables refer to [Configuring with environment variables]({{< relref "../../administration/configuration.md#override-configuration-with-environment-variables" >}}). diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index f0d01d1dba6..c222161310a 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -19,7 +19,7 @@ export interface FeatureToggles { trimDefaults?: boolean; envelopeEncryption?: boolean; httpclientprovider_azure_auth?: boolean; - ['service-accounts']?: boolean; + serviceAccounts?: boolean; database_metrics?: boolean; dashboardPreviews?: boolean; dashboardPreviewsScheduler?: boolean; diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index 2e7ce48be55..668426522bf 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -24,7 +24,7 @@ var ( State: FeatureStateBeta, }, { - Name: "service-accounts", + Name: "serviceAccounts", Description: "support service accounts", State: FeatureStateBeta, }, diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index 8d0c9764b32..9d92cc4cf21 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -21,7 +21,7 @@ const ( // FlagServiceAccounts // support service accounts - FlagServiceAccounts = "service-accounts" + FlagServiceAccounts = "serviceAccounts" // FlagDatabaseMetrics // Add prometheus metrics for database tables diff --git a/pkg/services/featuremgmt/usage_stats_test.go b/pkg/services/featuremgmt/usage_stats_test.go index 1bc5420e4ff..ca044aaece2 100644 --- a/pkg/services/featuremgmt/usage_stats_test.go +++ b/pkg/services/featuremgmt/usage_stats_test.go @@ -11,7 +11,7 @@ func TestFeatureUsageStats(t *testing.T) { featureManagerWithAllFeatures := WithFeatures( "trimDefaults", "httpclientprovider_azure_auth", - "service-accounts", + "serviceAccounts", "database_metrics", "dashboardPreviews", "live-config", diff --git a/pkg/services/serviceaccounts/manager/service.go b/pkg/services/serviceaccounts/manager/service.go index 71aba8ae775..aebed6a1b5c 100644 --- a/pkg/services/serviceaccounts/manager/service.go +++ b/pkg/services/serviceaccounts/manager/service.go @@ -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 { diff --git a/pkg/services/serviceaccounts/manager/service_test.go b/pkg/services/serviceaccounts/manager/service_test.go index 57f986a3fe9..f338e1f4b39 100644 --- a/pkg/services/serviceaccounts/manager/service_test.go +++ b/pkg/services/serviceaccounts/manager/service_test.go @@ -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"), }