mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
k8s: dashboards: remove FT (#97758)
This commit is contained in:
parent
4f7ffafe98
commit
b05d60e5b5
@ -170,7 +170,6 @@ Experimental features might be changed or removed without prior notice.
|
||||
| `disableClassicHTTPHistogram` | Disables classic HTTP Histogram (use with enableNativeHTTPHistogram) |
|
||||
| `kubernetesSnapshots` | Routes snapshot requests from /api to the /apis endpoint |
|
||||
| `kubernetesDashboards` | Use the kubernetes API in the frontend for dashboards |
|
||||
| `kubernetesDashboardsAPI` | Use the kubernetes API in the backend for dashboards |
|
||||
| `kubernetesFolders` | Use the kubernetes API in the frontend for folders, and route /api/folders requests to k8s |
|
||||
| `grafanaAPIServerTestingWithExperimentalAPIs` | Facilitate integration testing of experimental APIs |
|
||||
| `datasourceQueryTypes` | Show query type endpoints in datasource API servers (currently hardcoded for testdata, expressions, and prometheus) |
|
||||
|
@ -113,7 +113,6 @@ export interface FeatureToggles {
|
||||
kubernetesPlaylists?: boolean;
|
||||
kubernetesSnapshots?: boolean;
|
||||
kubernetesDashboards?: boolean;
|
||||
kubernetesDashboardsAPI?: boolean;
|
||||
kubernetesFolders?: boolean;
|
||||
grafanaAPIServerTestingWithExperimentalAPIs?: boolean;
|
||||
datasourceQueryTypes?: boolean;
|
||||
|
@ -21,14 +21,6 @@ var (
|
||||
_ builder.OpenAPIPostProcessor = (*DashboardsAPIBuilder)(nil)
|
||||
)
|
||||
|
||||
func FeatureEnabled(features featuremgmt.FeatureToggles) bool {
|
||||
return featuremgmt.AnyEnabled(features,
|
||||
featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs,
|
||||
featuremgmt.FlagKubernetesDashboardsAPI,
|
||||
featuremgmt.FlagKubernetesDashboards, // << the UI will call the new apis
|
||||
featuremgmt.FlagProvisioning)
|
||||
}
|
||||
|
||||
// This is used just so wire has something unique to return
|
||||
type DashboardsAPIBuilder struct{}
|
||||
|
||||
@ -36,9 +28,6 @@ func RegisterAPIService(
|
||||
features featuremgmt.FeatureToggles,
|
||||
apiregistration builder.APIRegistrar,
|
||||
) *DashboardsAPIBuilder {
|
||||
if !FeatureEnabled(features) {
|
||||
return nil // skip registration unless opting into experimental apis or dashboards in the k8s api
|
||||
}
|
||||
builder := &DashboardsAPIBuilder{}
|
||||
apiregistration.RegisterAPI(builder)
|
||||
return builder
|
||||
|
@ -62,10 +62,6 @@ func RegisterAPIService(cfg *setting.Cfg, features featuremgmt.FeatureToggles,
|
||||
tracing *tracing.TracingService,
|
||||
unified resource.ResourceClient,
|
||||
) *DashboardsAPIBuilder {
|
||||
if !dashboard.FeatureEnabled(features) {
|
||||
return nil // skip registration unless opting into experimental apis or dashboards in the k8s api
|
||||
}
|
||||
|
||||
softDelete := features.IsEnabledGlobally(featuremgmt.FlagDashboardRestore)
|
||||
dbp := legacysql.NewDatabaseProvider(sql)
|
||||
namespacer := request.GetNamespaceMapper(cfg)
|
||||
|
@ -58,10 +58,6 @@ func RegisterAPIService(cfg *setting.Cfg, features featuremgmt.FeatureToggles,
|
||||
tracing *tracing.TracingService,
|
||||
unified resource.ResourceClient,
|
||||
) *DashboardsAPIBuilder {
|
||||
if !dashboard.FeatureEnabled(features) {
|
||||
return nil // skip registration unless opting into experimental apis or dashboards in the k8s api
|
||||
}
|
||||
|
||||
softDelete := features.IsEnabledGlobally(featuremgmt.FlagDashboardRestore)
|
||||
dbp := legacysql.NewDatabaseProvider(sql)
|
||||
namespacer := request.GetNamespaceMapper(cfg)
|
||||
|
@ -58,10 +58,6 @@ func RegisterAPIService(cfg *setting.Cfg, features featuremgmt.FeatureToggles,
|
||||
tracing *tracing.TracingService,
|
||||
unified resource.ResourceClient,
|
||||
) *DashboardsAPIBuilder {
|
||||
if !dashboard.FeatureEnabled(features) {
|
||||
return nil // skip registration unless opting into experimental apis or dashboards in the k8s api
|
||||
}
|
||||
|
||||
softDelete := features.IsEnabledGlobally(featuremgmt.FlagDashboardRestore)
|
||||
dbp := legacysql.NewDatabaseProvider(sql)
|
||||
namespacer := request.GetNamespaceMapper(cfg)
|
||||
|
@ -719,13 +719,6 @@ var (
|
||||
Owner: grafanaAppPlatformSquad,
|
||||
FrontendOnly: true,
|
||||
},
|
||||
{
|
||||
Name: "kubernetesDashboardsAPI",
|
||||
Description: "Use the kubernetes API in the backend for dashboards",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaAppPlatformSquad,
|
||||
RequiresRestart: true, // changes the API routing
|
||||
},
|
||||
{
|
||||
Name: "kubernetesFolders",
|
||||
Description: "Use the kubernetes API in the frontend for folders, and route /api/folders requests to k8s",
|
||||
|
@ -94,7 +94,6 @@ transformationsVariableSupport,GA,@grafana/dataviz-squad,false,false,true
|
||||
kubernetesPlaylists,GA,@grafana/grafana-app-platform-squad,false,true,false
|
||||
kubernetesSnapshots,experimental,@grafana/grafana-app-platform-squad,false,true,false
|
||||
kubernetesDashboards,experimental,@grafana/grafana-app-platform-squad,false,false,true
|
||||
kubernetesDashboardsAPI,experimental,@grafana/grafana-app-platform-squad,false,true,false
|
||||
kubernetesFolders,experimental,@grafana/search-and-storage,false,false,false
|
||||
grafanaAPIServerTestingWithExperimentalAPIs,experimental,@grafana/search-and-storage,false,false,false
|
||||
datasourceQueryTypes,experimental,@grafana/grafana-app-platform-squad,false,true,false
|
||||
|
|
@ -387,10 +387,6 @@ const (
|
||||
// Use the kubernetes API in the frontend for dashboards
|
||||
FlagKubernetesDashboards = "kubernetesDashboards"
|
||||
|
||||
// FlagKubernetesDashboardsAPI
|
||||
// Use the kubernetes API in the backend for dashboards
|
||||
FlagKubernetesDashboardsAPI = "kubernetesDashboardsAPI"
|
||||
|
||||
// FlagKubernetesFolders
|
||||
// Use the kubernetes API in the frontend for folders, and route /api/folders requests to k8s
|
||||
FlagKubernetesFolders = "kubernetesFolders"
|
||||
|
@ -1872,19 +1872,6 @@
|
||||
"frontend": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "kubernetesDashboardsAPI",
|
||||
"resourceVersion": "1729017284006",
|
||||
"creationTimestamp": "2024-10-15T18:34:44Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "Use the kubernetes API in the backend for dashboards",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/grafana-app-platform-squad",
|
||||
"requiresRestart": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "kubernetesFeatureToggles",
|
||||
|
@ -10,8 +10,6 @@ import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/options"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/tests/apis"
|
||||
"github.com/grafana/grafana/pkg/tests/testinfra"
|
||||
@ -28,23 +26,6 @@ func TestMain(m *testing.M) {
|
||||
testsuite.Run(m)
|
||||
}
|
||||
|
||||
func TestIntegrationRequiresDevMode(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||
AppModeProduction: true, // should fail
|
||||
DisableAnonymous: true,
|
||||
APIServerStorageType: options.StorageTypeUnified, // tests local unified storage connection
|
||||
EnableFeatureToggles: []string{
|
||||
featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs, // Required to start the example service
|
||||
},
|
||||
})
|
||||
|
||||
_, err := helper.NewDiscoveryClient().ServerResourcesForGroupVersion("dashboard.grafana.app/v0alpha1")
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func runDashboardTest(t *testing.T, helper *apis.K8sTestHelper) {
|
||||
t.Run("simple crud+list", func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
@ -119,10 +100,6 @@ func TestIntegrationDashboardsApp(t *testing.T) {
|
||||
t.Run("with dual writer mode 0", func(t *testing.T) {
|
||||
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||
DisableAnonymous: true,
|
||||
EnableFeatureToggles: []string{
|
||||
featuremgmt.FlagKubernetesDashboardsAPI,
|
||||
featuremgmt.FlagKubernetesDashboards,
|
||||
},
|
||||
UnifiedStorageConfig: map[string]setting.UnifiedStorageConfig{
|
||||
"dashboards.dashboard.grafana.app": {
|
||||
DualWriterMode: 0,
|
||||
@ -135,10 +112,6 @@ func TestIntegrationDashboardsApp(t *testing.T) {
|
||||
t.Run("with dual writer mode 1", func(t *testing.T) {
|
||||
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||
DisableAnonymous: true,
|
||||
EnableFeatureToggles: []string{
|
||||
featuremgmt.FlagKubernetesDashboardsAPI,
|
||||
featuremgmt.FlagKubernetesDashboards,
|
||||
},
|
||||
UnifiedStorageConfig: map[string]setting.UnifiedStorageConfig{
|
||||
"dashboards.dashboard.grafana.app": {
|
||||
DualWriterMode: 1,
|
||||
@ -151,10 +124,6 @@ func TestIntegrationDashboardsApp(t *testing.T) {
|
||||
t.Run("with dual writer mode 2", func(t *testing.T) {
|
||||
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||
DisableAnonymous: true,
|
||||
EnableFeatureToggles: []string{
|
||||
featuremgmt.FlagKubernetesDashboardsAPI,
|
||||
featuremgmt.FlagKubernetesDashboards,
|
||||
},
|
||||
UnifiedStorageConfig: map[string]setting.UnifiedStorageConfig{
|
||||
"dashboards.dashboard.grafana.app": {
|
||||
DualWriterMode: 2,
|
||||
@ -167,10 +136,6 @@ func TestIntegrationDashboardsApp(t *testing.T) {
|
||||
t.Run("with dual writer mode 3", func(t *testing.T) {
|
||||
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||
DisableAnonymous: true,
|
||||
EnableFeatureToggles: []string{
|
||||
featuremgmt.FlagKubernetesDashboardsAPI,
|
||||
featuremgmt.FlagKubernetesDashboards,
|
||||
},
|
||||
UnifiedStorageConfig: map[string]setting.UnifiedStorageConfig{
|
||||
"dashboards.dashboard.grafana.app": {
|
||||
DualWriterMode: 3,
|
||||
@ -184,10 +149,6 @@ func TestIntegrationDashboardsApp(t *testing.T) {
|
||||
t.Skip("skipping test because of authorizer issue")
|
||||
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||
DisableAnonymous: true,
|
||||
EnableFeatureToggles: []string{
|
||||
featuremgmt.FlagKubernetesDashboardsAPI,
|
||||
featuremgmt.FlagKubernetesDashboards,
|
||||
},
|
||||
UnifiedStorageConfig: map[string]setting.UnifiedStorageConfig{
|
||||
"dashboards.dashboard.grafana.app": {
|
||||
DualWriterMode: 4,
|
||||
|
Loading…
Reference in New Issue
Block a user