k9s icon indicating copy to clipboard operation
k9s copied to clipboard

Regex anchors don't work for filtering

Open wholegrainloaf opened this issue 1 year ago • 1 comments




Describe the bug When using ^ and $ regex anchors, the filtering no longer works and returns an empty list instead of actually matching on resource names.

To Reproduce Steps to reproduce the behavior:

  1. Go to a resource list
  2. Click on / to start filtering
  3. Enter a regex filter like ^fancyPants
  4. Expect to see resources with names that start with fancyPants, but actually nothing shows up.
  5. Enter a regex filter like fancyPants
  6. Resources with that substring in their name show up, including ones that start with it

Historical Documents N/A

Expected behavior Resources matching the regex should show up since the k9s docs say:

Regex2 supported

Screenshots N/A

Versions (please complete the following information):

  • OS: OSX Sonoma 14.x.x
  • K9s: 0.32.5
  • K8s: 1.3x.x

Additional context N/A

wholegrainloaf avatar Aug 27 '24 21:08 wholegrainloaf

Resource filtering in k9s is very generic. User may want to filter on name but also ips, nodes, etc... for a given resource. The way search currently works is by flattening out rows and grepping on that. RX anchors tho supported are not effective here given the current strategy.

derailed avatar Aug 28 '24 15:08 derailed

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar May 17 '25 02:05 github-actions[bot]