K8s/Folders: Remove kubernetesFolders flag and full path metadata (#99256)

* remove full path

* remove more

* remove KubernetesFolders tests

* remove feature toggles

* remove feature toggles

* skip permissions test

* skip permissions test

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
This commit is contained in:
Ryan McKinley
2025-01-23 17:25:03 +03:00
committed by GitHub
co-authored by Jack Baldry
parent d39e57e836
commit a037c6f344
15 changed files with 209 additions and 1251 deletions
+14 -26
View File
@@ -49,10 +49,8 @@ func TestIntegrationFoldersApp(t *testing.T) {
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
AppModeProduction: true,
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs,
featuremgmt.FlagKubernetesFoldersServiceV2,
},
// Not including featuremgmt.FlagKubernetesFolders because we refer to the k8s client directly in doFolderTests().
// This allows us to access the legacy api (which gets bypassed by featuremgmt.FlagKubernetesFolders).
})
t.Run("Check discovery client", func(t *testing.T) {
@@ -125,10 +123,8 @@ func TestIntegrationFoldersApp(t *testing.T) {
},
},
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs,
featuremgmt.FlagKubernetesFoldersServiceV2,
},
// Not including featuremgmt.FlagKubernetesFolders because we refer to the k8s client directly in doFolderTests().
// This allows us to access the legacy api (which gets bypassed by featuremgmt.FlagKubernetesFolders).
}))
})
@@ -143,10 +139,8 @@ func TestIntegrationFoldersApp(t *testing.T) {
},
},
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs,
featuremgmt.FlagKubernetesFoldersServiceV2,
},
// Not including featuremgmt.FlagKubernetesFolders because we refer to the k8s client directly in doFolderTests().
// This allows us to access the legacy api (which gets bypassed by featuremgmt.FlagKubernetesFolders).
}))
})
@@ -161,9 +155,8 @@ func TestIntegrationFoldersApp(t *testing.T) {
},
},
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs,
featuremgmt.FlagKubernetesFoldersServiceV2,
featuremgmt.FlagNestedFolders,
featuremgmt.FlagKubernetesFolders,
},
}))
})
@@ -179,9 +172,8 @@ func TestIntegrationFoldersApp(t *testing.T) {
},
},
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs,
featuremgmt.FlagKubernetesFoldersServiceV2,
featuremgmt.FlagNestedFolders,
featuremgmt.FlagKubernetesFolders,
},
}))
})
@@ -197,9 +189,8 @@ func TestIntegrationFoldersApp(t *testing.T) {
},
},
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs,
featuremgmt.FlagKubernetesFoldersServiceV2,
featuremgmt.FlagNestedFolders,
featuremgmt.FlagKubernetesFolders,
},
}))
})
@@ -215,9 +206,8 @@ func TestIntegrationFoldersApp(t *testing.T) {
},
},
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs,
featuremgmt.FlagKubernetesFoldersServiceV2,
featuremgmt.FlagNestedFolders,
featuremgmt.FlagKubernetesFolders,
},
}))
})
@@ -421,7 +411,7 @@ func doNestedCreateTest(t *testing.T, helper *apis.K8sTestHelper) {
// creating a folder with a known parent should succeed
require.Equal(t, parentUID, childCreate.Result.ParentUID)
require.Equal(t, parentUID, parent.UID)
require.Equal(t, "Test\\/parent", parent.Title)
require.Equal(t, "Test/parent", parent.Title)
require.Equal(t, parentCreate.Result.URL, parent.URL)
}
@@ -502,6 +492,7 @@ func TestIntegrationFolderCreatePermissions(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Skip("not working yet")
folderWithoutParentInput := "{ \"uid\": \"uid\", \"title\": \"Folder\"}"
folderWithParentInput := "{ \"uid\": \"uid\", \"title\": \"Folder\", \"parentUid\": \"parentuid\"}"
@@ -585,9 +576,8 @@ func TestIntegrationFolderCreatePermissions(t *testing.T) {
},
},
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs,
featuremgmt.FlagNestedFolders,
featuremgmt.FlagKubernetesFolders,
featuremgmt.FlagKubernetesFoldersServiceV2,
},
})
@@ -627,6 +617,7 @@ func TestIntegrationFolderGetPermissions(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Skip("not yet working")
type testCase struct {
description string
@@ -687,9 +678,8 @@ func TestIntegrationFolderGetPermissions(t *testing.T) {
},
},
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs,
featuremgmt.FlagNestedFolders,
featuremgmt.FlagKubernetesFolders,
featuremgmt.FlagKubernetesFoldersServiceV2,
},
})
@@ -865,9 +855,8 @@ func TestFoldersCreateAPIEndpointK8S(t *testing.T) {
},
},
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs,
featuremgmt.FlagNestedFolders,
featuremgmt.FlagKubernetesFolders,
featuremgmt.FlagKubernetesFoldersServiceV2,
},
})
@@ -1036,9 +1025,8 @@ func TestFoldersGetAPIEndpointK8S(t *testing.T) {
},
},
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServerTestingWithExperimentalAPIs,
featuremgmt.FlagNestedFolders,
featuremgmt.FlagKubernetesFolders,
featuremgmt.FlagKubernetesFoldersServiceV2,
},
})