diff --git a/pkg/registry/apis/dashboard/mutate.go b/pkg/registry/apis/dashboard/mutate.go index f9cfd39d4c8..6ecd7a932c4 100644 --- a/pkg/registry/apis/dashboard/mutate.go +++ b/pkg/registry/apis/dashboard/mutate.go @@ -33,7 +33,7 @@ func (b *DashboardsAPIBuilder) Mutate(ctx context.Context, a admission.Attribute return err } - // TODO, before v1 and v2 final -- this should be required + // TODO? before v1 and v2 final -- this should be required if meta.GetFolder() == "" { meta.SetFolder(rootFolder) // "general" } diff --git a/pkg/services/ngalert/api/api_convert_prometheus_test.go b/pkg/services/ngalert/api/api_convert_prometheus_test.go index 7ad8ee3c0b4..374c6e517aa 100644 --- a/pkg/services/ngalert/api/api_convert_prometheus_test.go +++ b/pkg/services/ngalert/api/api_convert_prometheus_test.go @@ -1714,7 +1714,7 @@ func TestGetWorkingFolderUID(t *testing.T) { rc.Req.Header.Del(folderUIDHeader) folderUID := getWorkingFolderUID(rc) - require.Equal(t, folder.RootFolderUID, folderUID) + require.Equal(t, folder.EmptyFolderUID, folderUID) }) t.Run("should return specified folder UID when header is present", func(t *testing.T) { @@ -1731,7 +1731,7 @@ func TestGetWorkingFolderUID(t *testing.T) { rc.Req.Header.Set(folderUIDHeader, "") folderUID := getWorkingFolderUID(rc) - require.Equal(t, folder.RootFolderUID, folderUID) + require.Equal(t, folder.EmptyFolderUID, folderUID) }) t.Run("should trim whitespace from header value", func(t *testing.T) {