diff --git a/pkg/services/dashboards/service/dashboard_service.go b/pkg/services/dashboards/service/dashboard_service.go index eea8dd574ad..d1f78e34cb4 100644 --- a/pkg/services/dashboards/service/dashboard_service.go +++ b/pkg/services/dashboards/service/dashboard_service.go @@ -1690,6 +1690,16 @@ func (dr *DashboardServiceImpl) searchDashboardsThroughK8sRaw(ctx context.Contex } if len(query.FolderUIDs) > 0 { + // Grafana frontend issues a call to search for dashboards in "general" folder. General folder doesn't exists and + // should return all dashboards without a parent folder. + // We do something similar in the old sql search query https://github.com/grafana/grafana/blob/a58564a35efe8c05a21d8190b283af5bc0979d2a/pkg/services/sqlstore/searchstore/filters.go#L103 + for i := range query.FolderUIDs { + if query.FolderUIDs[i] == folder.GeneralFolderUID { + query.FolderUIDs[i] = "" + break + } + } + req := []*resource.Requirement{{ Key: resource.SEARCH_FIELD_FOLDER, Operator: string(selection.In),