-
Notifications
You must be signed in to change notification settings - Fork 369
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 support for custom indices #478
Conversation
Similar to brew tap, kubectl krew index should list the indices
Create a directory in receipts and store based on the custom index name to install the plugin/receipt
Using krew-indices for now to further reduce the chance of a plugin and index name collision
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: chriskim06 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report
@@ Coverage Diff @@
## master #478 +/- ##
==========================================
- Coverage 56.47% 54.85% -1.63%
==========================================
Files 19 19
Lines 926 957 +31
==========================================
+ Hits 523 525 +2
- Misses 350 377 +27
- Partials 53 55 +2
Continue to review full report at Codecov.
|
@chriskim06 While I totally appreciate you writing code, it's most likely that this has been the BIGGEST item on our list since the inception of Krew. We didn't discuss this at all and it's been on our list to design this first. Code is not important (yet). So I will close this PR, and ask you to open an issue with a Design proposal first. We care about:
more than the code. Let's discuss a design first, then we can revisit your patch. In Krew project, it's very unlikely we'll accept non-trivial patches of this size without discussing how it changes the user experience first. I'm hoping you're not surprised about this, you didn't let the maintainers know you're taking on this challenge. /close |
@ahmetb: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@ahmetb that makes sense, I'll open up a new issue with a more in depth design proposal. Sorry for doing these things out of order 😅 |
@ahmetb I'm not at all surprised, definitely knew it was possible for this to get closed when I opened the PR. I'm really looking forward to being able to use krew at work but custom indices is a must before that can happen (I'm sure that's the case for a lot of people). I'm still new to open source so sorry again if I'm going about things out of order/in a way that isn't conventional. Lesson learned though, in the future I will try to communicate these things through issues to you and the other maintainers! |
That's not at all a problem. |
I'm in the process of adding tests currently. I wanted to open the PR to write down the approach and maybe get some feedback. So here's a summary of the changes:
index
subcommandkubectl krew index
: lists the configured custom indiceskubectl krew index add custom-index https://github.com/custom/index.git
: adds a custom index with the namecustom-index
kubectl krew index remove custom-index
: removes the custom index with the namecustom-index
$KREW_ROOT/indexconfig.yaml
that contains an object whose key/values are a user defined name and URI of the index being added$KREW_ROOT/custom/{index name}
$KREW_ROOT/store/krew-indices/{index name}/{plugin}
$KREW_ROOT/receipts/{index name}/{plugin}.yaml
kubectl krew install custom-index/plugin
(this is similar to how its handled in homebrew; a follow up issue could be to handle plugin name collisions, but for this I only implemented allowing one or the other)kubectl krew upgrade custom-index/plugin
I think that covers most things at a high level. I took a lot of ideas from
brew tap
in working on this feature. Its definitely a rough first draft and I would love to get some feedback. I chose to do things in certain ways to try to make it as backwards compatible as possible. This is a really important feature in order for me to use this at work (which I'd love to do).