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>
pull/100683/head^2
Carl Bergquist 3 months ago committed by GitHub
parent 23a657a72d
commit 9cff383830
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      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
}

Loading…
Cancel
Save