From 9cff383830f44ee8b982c606c824095c0379119e Mon Sep 17 00:00:00 2001 From: Carl Bergquist Date: Fri, 14 Feb 2025 15:21:35 +0100 Subject: [PATCH] scopenodes: check if the query exists in the title instead of starts with the query (#100578) scopenodes: check if the string contains the search param instead of limiting to prefix Signed-off-by: bergquist --- pkg/registry/apis/scope/find.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/registry/apis/scope/find.go b/pkg/registry/apis/scope/find.go index b3d3d4c54b7..43cb057958a 100644 --- a/pkg/registry/apis/scope/find.go +++ b/pkg/registry/apis/scope/find.go @@ -104,9 +104,8 @@ func filterAndAppendItem(item scope.ScopeNode, parent string, query string, resu return // Someday this will have an index in raw storage on parentName } - // skip if query is passed and title doesn't match. - // HasPrefix is not the end goal but something that that gets us started. - if query != "" && !strings.HasPrefix(item.Spec.Title, query) { + // skip if query is passed and title doesn't contain the query. + if query != "" && !strings.Contains(item.Spec.Title, query) { return }