mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 23:53:10 +08:00
unified-storage: Reduce calls to the user service (#102934)
* Create ListByIdOrUID in user service * create UnstructuredToLegacyFolderList * update GetFolders to use list parser * update GetDescendants to use list parser * update UnstructuredToLegacyFolder to also make a single call to the user service --------- Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
This commit is contained in:
@ -11,6 +11,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/client"
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/folder"
|
||||
"github.com/grafana/grafana/pkg/services/user/usertest"
|
||||
"github.com/grafana/grafana/pkg/storage/unified/resource"
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/require"
|
||||
@ -93,7 +94,8 @@ func TestComputeFullPath(t *testing.T) {
|
||||
func TestGetParents(t *testing.T) {
|
||||
mockCli := new(client.MockK8sHandler)
|
||||
store := FolderUnifiedStoreImpl{
|
||||
k8sclient: mockCli,
|
||||
k8sclient: mockCli,
|
||||
userService: usertest.NewUserServiceFake(),
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
@ -187,7 +189,8 @@ func TestGetParents(t *testing.T) {
|
||||
func TestGetChildren(t *testing.T) {
|
||||
mockCli := new(client.MockK8sHandler)
|
||||
store := FolderUnifiedStoreImpl{
|
||||
k8sclient: mockCli,
|
||||
k8sclient: mockCli,
|
||||
userService: usertest.NewUserServiceFake(),
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
|
Reference in New Issue
Block a user