-
Notifications
You must be signed in to change notification settings - Fork 493
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
Add fuzzy plugin #660
Add fuzzy plugin #660
Conversation
Welcome @d-kuro! |
I don’t think it will be wise to assign the fzf name:
|
Thank you comments. For example, what if you renamed |
I think even |
Yeah, |
@ahmetb @corneliusweig I will modify this Pull Request after I have renamed the project and made a release. |
I renamed the project and fixed the Pull Request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please help me understand what your plugin really does. I'm not entirely sure from the description.
I do have concerns, if it's main purpose is to select an individual pod by fuzzy matching its name.
plugins/fuzzy.yaml
Outdated
os: windows | ||
arch: amd64 | ||
version: "v1.0.1" | ||
shortDescription: Fuzzy Finder Pod selector plugin. Currently "kubectl logs" and "kubectl exec" are supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please find a more succinct description for you plugin. Anything above ~50 chars gets usually truncated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, Thanks!
6eddc7e
plugins/fuzzy.yaml
Outdated
shortDescription: Fuzzy Finder Pod selector plugin. Currently "kubectl logs" and "kubectl exec" are supported. | ||
description: | | ||
Kubectl fuzzy is a kubectl plugin providing a Fuzzy Finder Pod selector. | ||
Uses go-fuzzyfinder, so there is no dependency on fzf binaries or anything else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an implementation detail and can safely be skipped in the description. I think it's better to be mentioned on the project homepage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the description.
6eddc7e
plugins/fuzzy.yaml
Outdated
version: "v1.0.1" | ||
shortDescription: Fuzzy Finder Pod selector plugin. Currently "kubectl logs" and "kubectl exec" are supported. | ||
description: | | ||
Kubectl fuzzy is a kubectl plugin providing a Fuzzy Finder Pod selector. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me what this plugin actually does. Is it really just for selecting pods by a fuzzy pattern? If that is indeed the case, I think this is not the right approach. The recommended way to select pods in Kubernetes is via labels. Selecting individual pods via fuzzy match seems pretty wonky to me.
My original assumption was that this plugin does some fuzzy magic on the output of some kubectl commands. Apparently, I misread this :/
FWIW, there are already a few plugins which focus on exec
and logs
commands. For example https://github.com/gabeduke/kubectl-iexec, https://gitlab.com/grzesuav/kubectl-mtail, https://github.com/boz/kail and probably more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment. I will fix the tool description.
That's right, you can select an object in the label selector.
But in order to use the label selector, you need to know which label is being used on the target Kubernetes object.
I was too lazy to look up labels, so I decided to create this tool.
A fuzzy search allows you to select an object without having to find out which label is used for the Kubernetes object.
As for exec and logs, I know there are other tools for interactively selecting pods, but I think that fuzzy searches differentiate them from other tools.
I have also added support for kubectl describe yesterday.
I'm going to add more features to this tool in the future.
https://github.com/d-kuro/kubectl-fuzzy/releases/tag/v1.1.0
I recommend installing and trying out. |
@corneliusweig Ping for the comment above. |
plugins/fuzzy.yaml
Outdated
os: windows | ||
arch: amd64 | ||
version: "v1.2.0" | ||
shortDescription: Fuzzy Finder Kubernetes object selector plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still not good. You should consider never using the word selector
. It has a specific meaning in Kubernetes that is causing all the misunderstanding w/ @corneliusweig and it will confuse users too.
You should update your repo and help messages ideally but here's my attempt at writing your description:
Fuzzy and partial string search for kubectl
full description:
This tool uses fzf(1) to do partial or fuzzy search of Kubernetes resources. Instead of specifying full resource names to kubectl commands, you can choose them from an interactive list that you can filter by typing a few characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the advice.
I think the description you have come up with is smart!
I'm sorry if I sound picky.
Strictly speaking, I use a different implementation of fuzzy finder than github.com/junegunn/fzf, so I'd like to rephrase it to fzf-like.
This tool uses a fzf(1)-like fuzzy-finder to do partial or fuzzy search of Kubernetes resources.
I will fix it. (at the same time, I will fix the repository README)
Co-authored-by: d-kuro <kurosawa7620@gmail.com>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahmetb, d-kuro The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@ahmetb Thanks for your support! |
Sorry for being such a 🐌.. and too late for the 🎉 |
This PR aims to add fuzzy plugin to krew index.
This plugin is a kubectl plugin providing a fuzzy finder selector.
There is a tool of the same name, but it is not kubectl plugin, so I thought it was OK.https://github.com/bonnefoa/kubectl-fzf
I'm open to suggestions about the problem.
Thanks!