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 <carl.bergquist@gmail.com>
This commit is contained in:
Carl Bergquist 2025-02-14 15:21:35 +01:00 committed by GitHub
parent 23a657a72d
commit 9cff383830
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}