K8s/Folders: Fix tests for creating folders (#94192)

* Add feature toggle grafanaAPIServerTestingWithExperimentalAPIs
* Customise registration of FolderAPIBuilder for tests and fix tests
This commit is contained in:
Arati R.
2024-10-03 12:11:40 +02:00
committed by GitHub
parent 1635a3cd67
commit a42caa7a61
8 changed files with 144 additions and 99 deletions
+2 -2
View File
@@ -47,8 +47,8 @@ func RegisterAPIService(cfg *setting.Cfg,
accessControl accesscontrol.AccessControl,
registerer prometheus.Registerer,
) *FolderAPIBuilder {
if !features.IsEnabledGlobally(featuremgmt.FlagKubernetesFolders) {
return nil // skip registration unless opting into Kubernetes folders
if !features.IsEnabledGlobally(featuremgmt.FlagKubernetesFolders) && !features.IsEnabledGlobally(featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs) {
return nil // skip registration unless opting into Kubernetes folders or unless we want to customise registration when testing
}
builder := &FolderAPIBuilder{