k9s icon indicating copy to clipboard operation
k9s copied to clipboard

Filter by label should be case-sensitive, otherwise it does not work (-l key) (+ also in alias commands)

Open Yunir opened this issue 1 year ago • 3 comments




Describe the bug The filter by label is case-sensetive and should preserve it's case in history of filters. Currently it's not and I cannot reuse the same filter. Also writing a custom alias to aliases.yaml turns my command to lowercase - that breaks my flow and does not allow to filter what I want to filter.

To Reproduce Steps to reproduce the behavior:

  1. Type :Node command
  2. Filter by label /-l eks.amazonaws.com/nodegroup=MyCluster-node-group-1 (this will work fine)
  3. press Esc to clear the filter
  4. Type / and then Tab (it will be lowercased) - press Enter - this filter now is not working, because it's lowercased

Also alias like: my-cluster-node-1: node -l eks.amazonaws.com/nodegroup=MyCluster-node-group-1 won't work, because when I type alias - it's command is also lowercased.

Expected behavior Don't lowercase commands in aliases and filter by labels, because they are case sensitive.

Versions (please complete the following information):

  • OS: OSX
  • K9s: 0.32.5
  • K8s: 1.28

Yunir avatar Aug 28 '24 09:08 Yunir

I think, that this fix https://github.com/derailed/k9s/pull/1432 is the cause of such problem currently.

Yunir avatar Aug 28 '24 12:08 Yunir

@Yunir I'm pretty sure the line that causes the case-sensitivity in filters is https://github.com/derailed/k9s/blob/v0.32.5/internal/model/history.go#L45

I just finished testing a patch locally before I saw your issue and removing that ToLower line fixed the issue.

tsndqst avatar Sep 18 '24 21:09 tsndqst

https://github.com/derailed/k9s/pull/2888

tsndqst avatar Sep 18 '24 21:09 tsndqst

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

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