From baed7d6dbed9df24aa7f3742364b768c66db9b6c Mon Sep 17 00:00:00 2001 From: Kyle Brandt Date: Thu, 9 May 2024 11:52:56 -0400 Subject: [PATCH] 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. --- pkg/registry/apis/scope/find.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/registry/apis/scope/find.go b/pkg/registry/apis/scope/find.go index 1690f62bd57..6ec96193448 100644 --- a/pkg/registry/apis/scope/find.go +++ b/pkg/registry/apis/scope/find.go @@ -82,7 +82,7 @@ func (r *findREST) Connect(ctx context.Context, name string, opts runtime.Object } 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 } results.Items = append(results.Items, scope.TreeItem{