Scopes: Fix logic in find call (#87565)

With Find, if the parent query parameter is empty or not provided, we want to list the top level of the forest.
This commit is contained in:
Kyle Brandt 2024-05-09 11:52:56 -04:00 committed by GitHub
parent c3936bbae2
commit baed7d6dbe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,7 +82,7 @@ func (r *findREST) Connect(ctx context.Context, name string, opts runtime.Object
} }
for _, item := range all.Items { for _, item := range all.Items {
if parent != item.Spec.ParentName && parent != "" { if parent != item.Spec.ParentName {
continue // Someday this will have an index in raw storage on parentName continue // Someday this will have an index in raw storage on parentName
} }
results.Items = append(results.Items, scope.TreeItem{ results.Items = append(results.Items, scope.TreeItem{