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

Add using alternative branch support for custom indexes #833

Closed
wants to merge 1 commit into from

Conversation

ardaguclu
Copy link

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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 10, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ardaguclu
Once this PR has been reviewed and has the lgtm label, please assign corneliusweig for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

Welcome @ardaguclu!

It looks like this is your first PR to kubernetes-sigs/krew 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/krew has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 10, 2023
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.
@ardaguclu
Copy link
Author

I created a temporary repository https://github.com/ardaguclu/krew-index-test for testing and only v1.2.3 branch in that repository contains a plugin(such as example) and uses patch in this PR by adding;

$ kubectl krew index add test https://github.com/ardaguclu/krew-index-test#v1.2.3

and it worked properly.

@ardaguclu
Copy link
Author

As discussed on referenced issue;
/close

@ardaguclu ardaguclu closed this Aug 11, 2023
@ardaguclu ardaguclu deleted the custom-branching branch August 11, 2023 07:01
@ardaguclu ardaguclu restored the custom-branching branch August 28, 2023 10:05
@ardaguclu
Copy link
Author

/reopen

@k8s-ci-robot
Copy link
Contributor

@ardaguclu: Reopened this PR.

In response to this:

/reopen

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.

@k8s-ci-robot k8s-ci-robot reopened this Aug 28, 2023
@ardaguclu ardaguclu closed this Aug 29, 2023
@ardaguclu ardaguclu deleted the custom-branching branch August 29, 2023 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants