|
|
|
|
@ -5,7 +5,6 @@ import ( |
|
|
|
|
"errors" |
|
|
|
|
"slices" |
|
|
|
|
|
|
|
|
|
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest" |
|
|
|
|
"github.com/prometheus/client_golang/prometheus" |
|
|
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
|
|
|
|
"k8s.io/apimachinery/pkg/runtime" |
|
|
|
|
@ -17,6 +16,8 @@ import ( |
|
|
|
|
common "k8s.io/kube-openapi/pkg/common" |
|
|
|
|
"k8s.io/kube-openapi/pkg/spec3" |
|
|
|
|
|
|
|
|
|
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest" |
|
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/apimachinery/identity" |
|
|
|
|
"github.com/grafana/grafana/pkg/apimachinery/utils" |
|
|
|
|
"github.com/grafana/grafana/pkg/apis/folder/v0alpha1" |
|
|
|
|
@ -55,8 +56,11 @@ func RegisterAPIService(cfg *setting.Cfg, |
|
|
|
|
accessControl accesscontrol.AccessControl, |
|
|
|
|
registerer prometheus.Registerer, |
|
|
|
|
) *FolderAPIBuilder { |
|
|
|
|
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
|
|
|
|
|
if !featuremgmt.AnyEnabled(features, |
|
|
|
|
featuremgmt.FlagKubernetesFolders, |
|
|
|
|
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs, |
|
|
|
|
featuremgmt.FlagProvisioning) { |
|
|
|
|
return nil // skip registration unless opting into Kubernetes folders or unless we want to customize registration when testing
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
builder := &FolderAPIBuilder{ |
|
|
|
|
|