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

print warning when delete current context #42538

Merged
merged 1 commit into from
Apr 7, 2017

Conversation

adohe-zz
Copy link

@adohe-zz adohe-zz commented Mar 5, 2017

mirror update to kubectl. fix #42012 @smarterclayton ptal.

Release Note:

print warning when delete current context

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 5, 2017
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Mar 5, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@rootfs
Copy link
Contributor

rootfs commented Mar 6, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 6, 2017
@k8s-github-robot k8s-github-robot added the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Mar 6, 2017
@@ -71,6 +71,10 @@ func runDeleteContext(out io.Writer, configAccess clientcmd.ConfigAccess, cmd *c
return fmt.Errorf("cannot delete context %s, not in %s", name, configFile)
}

if config.CurrentContext == name {
fmt.Fprint(out, "warning: this removed your active context, use \"kubectl config use-context\" to select a different one\n")
Copy link
Member

Choose a reason for hiding this comment

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

It would be better to print the warning to stderr.

@mengqiy
Copy link
Member

mengqiy commented Mar 8, 2017

@adohe I think we should have a release note for this.

@mengqiy
Copy link
Member

mengqiy commented Mar 10, 2017

@k8s-bot non-cri node e2e test this
@k8s-bot gce etcd3 e2e test this

@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 12, 2017
@adohe-zz
Copy link
Author

@ymqytw comment addressed. ptal

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 12, 2017
Copy link
Member

@mengqiy mengqiy left a comment

Choose a reason for hiding this comment

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

One minor comment, other LGTM

@@ -65,7 +65,7 @@ func (test deleteContextTest) run(t *testing.T) {
pathOptions.EnvVar = ""

buf := bytes.NewBuffer([]byte{})
cmd := NewCmdConfigDeleteContext(buf, pathOptions)
cmd := NewCmdConfigDeleteContext(buf, nil, pathOptions)
Copy link
Member

Choose a reason for hiding this comment

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

I think it will be safer to pass in a io.writer instead of nil. Otherwise, it will panic if we print some error message in the stderr in the future.

Copy link
Author

Choose a reason for hiding this comment

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

Sounds reasonable tome. Some defensive programming would be better here. Updated

@mengqiy
Copy link
Member

mengqiy commented Mar 13, 2017

/assign @ymqytw

@mengqiy
Copy link
Member

mengqiy commented Mar 13, 2017

/lgtm
Thanks

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 13, 2017
@pwittrock
Copy link
Member

/approve

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 13, 2017
@mengqiy
Copy link
Member

mengqiy commented Mar 13, 2017

Anyone help to change the milestone to 1.6?

@pwittrock pwittrock added this to the next-candidate milestone Mar 13, 2017
@pwittrock
Copy link
Member

This is not a launch blocker. Moving to next milestone.

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

The following people have approved this PR: AdoHe, pwittrock, rootfs, ymqytw

Needs approval from an approver in each of these OWNERS Files:

We suggest the following people:
cc @smarterclayton
You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@mengqiy
Copy link
Member

mengqiy commented Mar 29, 2017

@k8s-bot kubemark e2e test this

@mengqiy
Copy link
Member

mengqiy commented Mar 29, 2017

@k8s-bot cvm gce e2e test this

@mengqiy
Copy link
Member

mengqiy commented Mar 30, 2017

/release-note

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Mar 30, 2017
@mengqiy
Copy link
Member

mengqiy commented Mar 30, 2017

@pwittrock Please help remove the do-not-merge label.

@mengqiy
Copy link
Member

mengqiy commented Apr 7, 2017

@k8s-bot non-cri node e2e test this

@mengqiy
Copy link
Member

mengqiy commented Apr 7, 2017

@fabianofranz Mind removing the do-not-merge label?

@fabianofranz fabianofranz removed the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Apr 7, 2017
@fabianofranz
Copy link
Contributor

@ymqytw sure, done.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 44119, 42538, 43802, 42336, 43396)

@k8s-github-robot k8s-github-robot merged commit bf766f4 into kubernetes:master Apr 7, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Deleting current context in kubectl doesn't allow you to set a context
9 participants