apiserver/folders: use exact match on GetFolderByTitle in legacy (#106867)

* apiserver/folders: use exact match on GetFolderByTitle in legacy

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>


---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
This commit is contained in:
maicon
2025-06-24 17:42:08 -03:00
committed by GitHub
parent 988d889ba7
commit 8a05378ef3
9 changed files with 150 additions and 25 deletions
@@ -792,11 +792,16 @@ func TestGetFoldersFromApiServer(t *testing.T) {
service.unifiedStore = fakeFolderStore
fakeK8sClient.On("Search", mock.Anything, int64(1), &resourcepb.ResourceSearchRequest{
Options: &resourcepb.ListOptions{
Key: folderkey,
Fields: []*resourcepb.Requirement{},
Key: folderkey,
Fields: []*resourcepb.Requirement{
&resourcepb.Requirement{
Key: resource.SEARCH_FIELD_TITLE_PHRASE, // nolint:staticcheck
Operator: string(selection.Equals),
Values: []string{"foo title"},
},
},
Labels: []*resourcepb.Requirement{},
},
Query: "foo title",
Limit: folderSearchLimit}).
Return(&resourcepb.ResourceSearchResponse{
Results: &resourcepb.ResourceTable{