mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
K8S: cleanup and consolidate feature toggles (#63212)
This commit is contained in:
@@ -3,22 +3,12 @@ package service
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/store/entity"
|
||||
"github.com/grafana/grafana/pkg/services/store/k8saccess"
|
||||
)
|
||||
|
||||
func ProvideSimpleDashboardService(
|
||||
features featuremgmt.FeatureToggles,
|
||||
svc *DashboardServiceImpl,
|
||||
k8s k8saccess.K8SAccess,
|
||||
store entity.EntityStoreServer,
|
||||
) dashboards.DashboardService {
|
||||
if features.IsEnabled(featuremgmt.FlagK8sDashboards) {
|
||||
if k8s.GetSystemClient() == nil {
|
||||
panic("k8s dashboards requires the k8s client registered")
|
||||
}
|
||||
return k8saccess.NewDashboardService(svc, store)
|
||||
}
|
||||
return svc
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user