kubernetes-sigs / krew

📦 Find and install kubectl plugins
https://krew.sigs.k8s.io
Apache License 2.0
6.42k stars 369 forks source link

Support `krew search` plugins by name and description #799

Closed astraw99 closed 1 year ago

astraw99 commented 2 years ago

Fixes #798

Support fuzzy search plugins by name and description, like this:

$ kubectl krew search kubeconfig

NAME                            DESCRIPTION                                         INSTALLED
allctx                          Run commands on contexts in your kubeconfig         no
config-cleanup                  Automatically clean up your kubeconfig              no
config-registry                 Switch between registered kubeconfigs               no
ctx                             Switch between contexts in your kubeconfig          yes
discover                        Find/export kubeconfigs for cloud clusters          no
kc                              Interactive CRUD operations to manage kubeconfig    yes
konfig                          Merge, split or import kubeconfig files             no
passman                         Store kubeconfig credentials in keychains or pa...  no
switch-config                   Switches between kubeconfig files                   no
view-serviceaccount-kubeconfig  Show a kubeconfig setting to access the apiserv...  no

Also added test case to make it correct, and checked all the other search test cases.

astraw99 commented 2 years ago

/ping @ahmetb PTAL thanks.

ahmetb commented 2 years ago

Thanks, I'll try to find some time, play with this hands-on and review.

astraw99 commented 2 years ago

OK, thanks.

astraw99 commented 2 years ago

/ping @ahmetb

ahmetb commented 2 years ago

Sorry, the linter seems to be extra-aggressive about not preallocating slices, it seems. This wasn't the case in the past, hence my comment about making them simpler.

astraw99 commented 2 years ago

Got it, updated. PTAL thanks.

astraw99 commented 2 years ago

/ping @ahmetb

astraw99 commented 2 years ago

/ping @ahmetb

astraw99 commented 1 year ago

@ahmetb Could you please give a lgtm label to make it merged, thanks.

ahmetb commented 1 year ago

Sorry for the latency here. I did a review again. I think if you refactor the tests to clearly show something like "name matches are shown first, then the description matches" it would help us maintainers reason about the code/tests later on. Thanks.

astraw99 commented 1 year ago

Sorry for the latency here. I did a review again. I think if you refactor the tests to clearly show something like "name matches are shown first, then the description matches" it would help us maintainers reason about the code/tests later on. Thanks.

Updated, PTAL thanks.

astraw99 commented 1 year ago

ping @ahmetb PTAL thanks.

astraw99 commented 1 year ago

ping @ahmetb PTAL thanks.

astraw99 commented 1 year ago

ping @ahmetb PTAL thanks.

ahmetb commented 1 year ago

/lgtm /approve Thanks!

k8s-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmetb, astraw99

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/krew/blob/master/OWNERS)~~ [ahmetb] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment