diff --git a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md index e628d8caa8d..5dae76b7c47 100644 --- a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md +++ b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md @@ -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) | diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index 103edd0aca8..d7702e76152 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -113,7 +113,6 @@ export interface FeatureToggles { kubernetesPlaylists?: boolean; kubernetesSnapshots?: boolean; kubernetesDashboards?: boolean; - kubernetesDashboardsAPI?: boolean; kubernetesFolders?: boolean; grafanaAPIServerTestingWithExperimentalAPIs?: boolean; datasourceQueryTypes?: boolean; diff --git a/pkg/registry/apis/dashboard/register.go b/pkg/registry/apis/dashboard/register.go index 202273d64e5..d40ba27d45b 100644 --- a/pkg/registry/apis/dashboard/register.go +++ b/pkg/registry/apis/dashboard/register.go @@ -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 diff --git a/pkg/registry/apis/dashboard/v0alpha1/register.go b/pkg/registry/apis/dashboard/v0alpha1/register.go index 4c42f814303..bc3fabcfebe 100644 --- a/pkg/registry/apis/dashboard/v0alpha1/register.go +++ b/pkg/registry/apis/dashboard/v0alpha1/register.go @@ -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) diff --git a/pkg/registry/apis/dashboard/v1alpha1/register.go b/pkg/registry/apis/dashboard/v1alpha1/register.go index 24f020cf962..7034b5ed0ef 100644 --- a/pkg/registry/apis/dashboard/v1alpha1/register.go +++ b/pkg/registry/apis/dashboard/v1alpha1/register.go @@ -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) diff --git a/pkg/registry/apis/dashboard/v2alpha1/register.go b/pkg/registry/apis/dashboard/v2alpha1/register.go index aba5b8c4e9d..c6ee4882420 100644 --- a/pkg/registry/apis/dashboard/v2alpha1/register.go +++ b/pkg/registry/apis/dashboard/v2alpha1/register.go @@ -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) diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index 730ad3741d0..9a087268a45 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -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", diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index 78efd1d260b..c992152469b 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -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 diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index f5614c5c001..06f2cb22dea 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -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" diff --git a/pkg/services/featuremgmt/toggles_gen.json b/pkg/services/featuremgmt/toggles_gen.json index 324b18dee2f..33f7e351daa 100644 --- a/pkg/services/featuremgmt/toggles_gen.json +++ b/pkg/services/featuremgmt/toggles_gen.json @@ -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", diff --git a/pkg/tests/apis/dashboard/dashboards_test.go b/pkg/tests/apis/dashboard/dashboards_test.go index b9037e9d71e..6df09d87578 100644 --- a/pkg/tests/apis/dashboard/dashboards_test.go +++ b/pkg/tests/apis/dashboard/dashboards_test.go @@ -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,