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

Support krew search plugins by name and description #799

Merged
merged 1 commit into from
Jun 3, 2023

Conversation

astraw99
Copy link
Contributor

@astraw99 astraw99 commented Sep 4, 2022

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 4, 2022
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 4, 2022
cmd/krew/cmd/search.go Outdated Show resolved Hide resolved
cmd/krew/cmd/search.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 5, 2022
@astraw99
Copy link
Contributor Author

/ping @ahmetb
PTAL thanks.

@ahmetb
Copy link
Member

ahmetb commented Sep 22, 2022

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

@astraw99
Copy link
Contributor Author

OK, thanks.

@astraw99
Copy link
Contributor Author

astraw99 commented Oct 17, 2022

/ping @ahmetb

Copy link
Member

@ahmetb ahmetb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly cosmetic comments.
/approve

cmd/krew/cmd/search.go Outdated Show resolved Hide resolved
cmd/krew/cmd/search.go Outdated Show resolved Hide resolved
cmd/krew/cmd/search_test.go Outdated Show resolved Hide resolved
cmd/krew/cmd/search_test.go Outdated Show resolved Hide resolved
cmd/krew/cmd/search_test.go Outdated Show resolved Hide resolved
cmd/krew/cmd/search_test.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 19, 2022
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 19, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 19, 2022
@ahmetb
Copy link
Member

ahmetb commented Oct 19, 2022

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
Copy link
Contributor Author

Got it, updated.
PTAL thanks.

@astraw99
Copy link
Contributor Author

astraw99 commented Nov 2, 2022

/ping @ahmetb

1 similar comment
@astraw99
Copy link
Contributor Author

/ping @ahmetb

@astraw99
Copy link
Contributor Author

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

cmd/krew/cmd/search.go Outdated Show resolved Hide resolved
cmd/krew/cmd/search_test.go Outdated Show resolved Hide resolved
cmd/krew/cmd/search_test.go Outdated Show resolved Hide resolved
@ahmetb
Copy link
Member

ahmetb commented Dec 14, 2022

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 astraw99 force-pushed the ftr-search-by-desc branch 2 times, most recently from bf3eece to b2fef6c Compare December 15, 2022 10:17
@astraw99
Copy link
Contributor Author

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.

cmd/krew/cmd/search.go Outdated Show resolved Hide resolved
cmd/krew/cmd/search.go Outdated Show resolved Hide resolved
cmd/krew/cmd/search.go Outdated Show resolved Hide resolved
@astraw99
Copy link
Contributor Author

ping @ahmetb
PTAL thanks.

@astraw99
Copy link
Contributor Author

astraw99 commented Apr 3, 2023

ping @ahmetb
PTAL thanks.

1 similar comment
@astraw99
Copy link
Contributor Author

astraw99 commented Jun 3, 2023

ping @ahmetb
PTAL thanks.

@ahmetb
Copy link
Member

ahmetb commented Jun 3, 2023

/lgtm
/approve
Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 3, 2023
@k8s-ci-robot
Copy link
Contributor

[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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 0fc730c into kubernetes-sigs:master Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support krew search plugins by name and description
3 participants