k8s: dashboards: remove FT (#97758)

pull/97774/head
Stephanie Hingtgen 5 months ago committed by GitHub
parent 4f7ffafe98
commit b05d60e5b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md
  2. 1
      packages/grafana-data/src/types/featureToggles.gen.ts
  3. 11
      pkg/registry/apis/dashboard/register.go
  4. 4
      pkg/registry/apis/dashboard/v0alpha1/register.go
  5. 4
      pkg/registry/apis/dashboard/v1alpha1/register.go
  6. 4
      pkg/registry/apis/dashboard/v2alpha1/register.go
  7. 7
      pkg/services/featuremgmt/registry.go
  8. 1
      pkg/services/featuremgmt/toggles_gen.csv
  9. 4
      pkg/services/featuremgmt/toggles_gen.go
  10. 13
      pkg/services/featuremgmt/toggles_gen.json
  11. 39
      pkg/tests/apis/dashboard/dashboards_test.go

@ -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

1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
94 kubernetesPlaylists GA @grafana/grafana-app-platform-squad false true false
95 kubernetesSnapshots experimental @grafana/grafana-app-platform-squad false true false
96 kubernetesDashboards experimental @grafana/grafana-app-platform-squad false false true
kubernetesDashboardsAPI experimental @grafana/grafana-app-platform-squad false true false
97 kubernetesFolders experimental @grafana/search-and-storage false false false
98 grafanaAPIServerTestingWithExperimentalAPIs experimental @grafana/search-and-storage false false false
99 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…
Cancel
Save