-
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 using alternative branch support for custom indexes #833
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ardaguclu 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 |
Welcome @ardaguclu! |
Currently, when user adds a custom index, Krew clones this repository from the default branch statically. Since distributions of most of plugins are managed in these default branches(master, main, etc.), it works without problem. On the other hand, this mechanism does not work for the plugins that using branching strategy per release. For a specific cluster version, plugin maintainers want to force users to use only specific major version(and auto updates of minor versions via Krew). For example, for my cluster v1.2.X, user should use 1.2.X which means that user should add Krew custom index only being encompassed by this branch and I'll continue working on master branch for the next release cycle, v2.0.X. without impacting v1.2.X releases. This PR proposes alternative branching support by appending branch name with `#` symbol. Since we are setting this branch name as default during clone phase, the rest of the functionality will remain same. If user wants to use different branch name for the same git uri, user should remove index first and re-add it with the name branch name.
cc75586
to
5b0d1ad
Compare
I created a temporary repository https://github.com/ardaguclu/krew-index-test for testing and only $ kubectl krew index add test https://github.com/ardaguclu/krew-index-test#v1.2.3 and it worked properly. |
As discussed on referenced issue; |
/reopen |
@ardaguclu: Reopened 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. |
Currently, when user adds a custom index, Krew clones this repository from the default branch statically. Since distributions of most of plugins are
managed in these default branches(master, main, etc.), it works without problem.
On the other hand, this mechanism does not work for the plugins that using branching strategy per release. For a specific cluster version, plugin maintainers want to force users to use only specific major version(and auto updates of minor versions via Krew). For example, for my cluster v1.2.X, user should use 1.2.X which means that user should add Krew custom index only being encompassed by this branch and I'll continue working on master branch for the next release cycle, v2.0.X. without impacting v1.2.X releases.
This PR proposes alternative branching support by appending branch name with
#
symbol. Since we are setting this branch name as default during clone phase, the rest of the functionality will remain same. If user wants to use different branch name for the same git uri, user should remove index first and re-add it with the name branch name.Related issue: #832