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

Fix update-context to use KUBECONFIG when the env is set #6090

Merged
merged 1 commit into from
Dec 18, 2019
Merged

Fix update-context to use KUBECONFIG when the env is set #6090

merged 1 commit into from
Dec 18, 2019

Conversation

govargo
Copy link
Contributor

@govargo govargo commented Dec 16, 2019

What type of PR is this?

/kind bug

What this PR does / why we need it:

When user executes minikube update-context with KUBECONFIG env, the command fails.

KUBECONFIG=/tmp/.somewhereelse/config minikube update-context
💣 update config: Kubeconfig does not have a record of the machine cluster
😿 Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
👉 https://github.com/kubernetes/minikube/issues/new/choose

This is because the update-context uses only $HOME/.kube/config(KUBECONFIG env will be ignored).
This PR allows users to use KUBECONFIG env when they execute minikube update-context
If the KUBECONFIG env is not set, $HOME/.kube/config filepath will be used.

Which issue(s) this PR fixes:

Fixes #5944

Does this PR introduce a user-facing change?

Yes.
This PR fixes bug when the user executes KUBECONFIG=xxxx minikube update-context

Before this PR, KUBECONFIG=xxxx minikube update-context command may fail(update-context uses $HOME/.kube/config)

KUBECONFIG=/tmp/.somewhereelse/config minikube update-context
💣 update config: Kubeconfig does not have a record of the machine cluster
😿 Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
👉 https://github.com/kubernetes/minikube/issues/new/choose

After this PR, KUBECONFIG=xxxx minikube update-context command successes

KUBECONFIG=/tmp/.somewhereelse/config minikube update-context
minikube IP has been updated to point at xxx.xxx.xxx.xxx
or
minikube IP was already correctly configured for xxx.xxx.xxx.xxx

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

NONE

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. 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. labels Dec 16, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @govargo. Thanks for your PR.

I'm waiting for a 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/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 16, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: govargo
To complete the pull request process, please assign ra489
You can assign the PR to them by writing /assign @ra489 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

@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@govargo
Copy link
Contributor Author

govargo commented Dec 16, 2019

/assign @RA489

@tstromberg
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 17, 2019
@tstromberg
Copy link
Contributor

Thank you!

@tstromberg tstromberg merged commit cf50577 into kubernetes:master Dec 18, 2019
@govargo govargo deleted the fix-update-context-kubeconfig-env branch March 6, 2020 10:15
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. kind/bug Categorizes issue or PR as related to a bug. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update-context not working when using KUBECONFIG
5 participants