ManagedServiceAccounts: Add a config option to disable the feature on-prem (#93571)

* ManagedServiceAccounts: Add a config option to disabled by default

* Update log in pkg/services/extsvcauth/registry/service.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit is contained in:
Gabriel MABILLE
2024-09-27 09:11:59 +02:00
committed by GitHub
parent 2cfba519f1
commit 7928245eb6
13 changed files with 53 additions and 27 deletions
+2 -1
View File
@@ -40,6 +40,7 @@ func NewServiceAccountsAPI(
permissionService accesscontrol.ServiceAccountPermissionsService,
features featuremgmt.FeatureToggles,
) *ServiceAccountsAPI {
enabled := features.IsEnabledGlobally(featuremgmt.FlagExternalServiceAccounts) && cfg.ManagedServiceAccountsEnabled
return &ServiceAccountsAPI{
cfg: cfg,
service: service,
@@ -48,7 +49,7 @@ func NewServiceAccountsAPI(
RouterRegister: routerRegister,
log: log.New("serviceaccounts.api"),
permissionService: permissionService,
isExternalSAEnabled: features.IsEnabledGlobally(featuremgmt.FlagExternalServiceAccounts),
isExternalSAEnabled: enabled,
}
}