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

update-context: Automatically set the context as current/active in ku… #9281

Merged
merged 1 commit into from
Sep 21, 2020

Conversation

prezha
Copy link
Contributor

@prezha prezha commented Sep 20, 2020

fixes #9246

example scenario:

common starting point:

❯ minikube profile list
|---------------------------------|-----------|---------|------------|------|---------|---------|
|             Profile             | VM Driver | Runtime |     IP     | Port | Version | Status  |
|---------------------------------|-----------|---------|------------|------|---------|---------|
| functional-20200910153511-83042 | docker    | docker  | 172.17.0.3 | 8443 | v1.19.2 | Running |
|---------------------------------|-----------|---------|------------|------|---------|---------|

❯ kubectl get pods -A
The connection to the server localhost:8080 was refused - did you specify the right host or port?

❯ kubectl config get-contexts
CURRENT   NAME                              CLUSTER                           AUTHINFO                                                       NAMESPACE
          functional-20200910153511-83042   functional-20200910153511-83042   functional-20200910153511-83042

before PR:

❯ minikube update-context -p functional-20200910153511-83042
🙄  No changes required for the "functional-20200910153511-83042" context

❯ kubectl get pods -A
The connection to the server localhost:8080 was refused - did you specify the right host or port?

❯ kubectl config get-contexts
CURRENT   NAME                              CLUSTER                           AUTHINFO                                                       NAMESPACE
          functional-20200910153511-83042   functional-20200910153511-83042   functional-20200910153511-83042

after PR:

❯ minikube update-context -p functional-20200910153511-83042
🙄  No changes required for the "functional-20200910153511-83042" context
💗  Current context is "functional-20200910153511-83042"

❯ kubectl get pods -A
NAMESPACE     NAME                                                      READY   STATUS    RESTARTS   AGE
kube-system   coredns-f9fd979d6-gqgcm                                   1/1     Running   0          8m35s
kube-system   etcd-functional-20200910153511-83042                      1/1     Running   0          8m32s
kube-system   kube-apiserver-functional-20200910153511-83042            1/1     Running   0          8m32s
kube-system   kube-controller-manager-functional-20200910153511-83042   1/1     Running   0          8m32s
kube-system   kube-proxy-8vnrd                                          1/1     Running   0          8m34s
kube-system   kube-scheduler-functional-20200910153511-83042            1/1     Running   0          8m32s
kube-system   storage-provisioner                                       1/1     Running   1          8m38s

❯ kubectl config get-contexts
CURRENT   NAME                              CLUSTER                           AUTHINFO                                                       NAMESPACE
*         functional-20200910153511-83042   functional-20200910153511-83042   functional-20200910153511-83042

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

Hi @prezha. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 20, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@codecov-commenter
Copy link

Codecov Report

Merging #9281 into master will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9281      +/-   ##
==========================================
- Coverage   29.48%   29.47%   -0.02%     
==========================================
  Files         170      170              
  Lines       10307    10311       +4     
==========================================
  Hits         3039     3039              
- Misses       6846     6850       +4     
  Partials      422      422              
Impacted Files Coverage Δ
cmd/minikube/cmd/update-context.go 0.00% <0.00%> (ø)

@prezha
Copy link
Contributor Author

prezha commented Sep 20, 2020

/assign @medyagh

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prezha thank you for this PR, would you please put the before/after this PR output in the PR descripion.

@prezha
Copy link
Contributor Author

prezha commented Sep 21, 2020

@medyagh thank you for your comment - i've added example output before and after this PR (with the common starting point), similar to your example in the issue description

please let me know if i should add more details

@prezha prezha requested a review from medyagh September 21, 2020 18:40
Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you @prezha for this PR

@medyagh medyagh merged commit f5b74f9 into kubernetes:master Sep 21, 2020
@prezha
Copy link
Contributor Author

prezha commented Sep 21, 2020

thank you @prezha for this PR

you're very welcome @medyagh, and thank you for your review and comments

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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minikube update-context should also make the context Active
5 participants