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 an option to update kubeconfig #790

Closed

Conversation

barkbay
Copy link
Contributor

@barkbay barkbay commented Aug 21, 2019

This feature is motivated by the fact that most of our current deployments (minikube, gke ...) are managed through the default kubeconfig file.
It might also be convenient for people that use tools like kubecxt.
With this PR user can add --set-context when a cluster is created to import the new context to its kubeconfig.

Note that it does not remove the context when the cluster is deleted, but it can be done in an other PR (I wanted to keep this one small).
Also I'm not sure about the unit test policy, I can add some of them to at least cover the merge with the current kubeconfig (could also be done in an other PR)

Let me know your thoughts.

This PR supersedes:

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: barkbay
To complete the pull request process, please assign munnerz
You can assign the PR to them by writing /assign @munnerz in a comment when ready.

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 k8s-ci-robot requested review from amwat and aojea August 21, 2019 15:40
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 21, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @barkbay. Thanks for your PR.

I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 21, 2019
@BenTheElder
Copy link
Member

We should discuss this in an issue I think, there's some design and tradeoffs involved.

The users field is going to collide if multiple kind clusters are created IIRC.
This re-introduces a direct dependency on client-go which may make kind harder to depend on in test harnesses.
The flag name is not quite clear in versus actually happens.
Maybe this should be the new default?

This is definitely a neat feature, but it can also be accomplished with a tiny bit of kubectl in the meantime, other than the merging issue which we need to settle on a solution for.

@barkbay
Copy link
Contributor Author

barkbay commented Aug 22, 2019

We should discuss this in an issue I think, there's some design and tradeoffs involved.

I have created #802

The users field is going to collide if multiple kind clusters are created IIRC.

Yes, this PR takes care of that by adding the cluster name as a suffix.

This re-introduces a direct dependency on client-go which may make kind harder to depend on in test harnesses.

👍 makes sense

The flag name is not quite clear in versus actually happens.
Maybe this should be the new default?

Agreed

@BenTheElder
Copy link
Member

This is done by default now in a way that closely marches other tools. Ref #850
Thanks for the PR 🙃

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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. 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.

3 participants