Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Yunir opened this issue Aug 28, 2024 · 3 comments

Comments

@Yunir
Copy link

Yunir commented Aug 28, 2024




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 Yunir changed the title Filter by label should be case-sensetive, otherwise it does not work (-l key) (+ also in alias commands) Filter by label should be case-sensitive, otherwise it does not work (-l key) (+ also in alias commands) Aug 28, 2024
@Yunir
Copy link
Author

Yunir commented Aug 28, 2024

I think, that this fix #1432 is the cause of such problem currently.

@tsndqst
Copy link

tsndqst commented Sep 18, 2024

@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
Copy link

tsndqst commented Sep 18, 2024

#2888

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants