k9s
k9s copied to clipboard
Add filter commandline parameter
Summary
This PR adds -f
/--filter
commandline parameter that sets default filter
Testing
Manual tests, unit tests
Thanks for proposing this PR! This is a missing feature I am looking forward to. It would be nice to have it because otherwise I have to manually type in the filter each time I enter k9s.
However, I tried this PR with ./k9s -n mork -f '-l service=MY_SERVICE'
it does not show the filtered view when I entered the interface. Am I doing something wrong?
FWIW, when I type '/', I see -l service=MY_SERVICE
in the filter history which saves me from typing.
@vmingchen I haven't tested -l a=b
initially. I pushed a new, hopefully less hacky, approach. It support both filter
and -l a=b
filters. I'll try to make codebeat happy,
OK, codebeat is happy now. It feels like whack-a-mole, ngl. All in all, I am not sure that the current version is actually btter than 8207681e76dd80606e982b790aafbb658a283d9c. @derailed Could you please advise? 🙏
Great! The '-l' filter is working for me now. Thanks a lot for the fix!