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 kubectl version should print version info without config file #89913

Conversation

zhouya0
Copy link
Contributor

@zhouya0 zhouya0 commented Apr 7, 2020

What type of PR is this?
/kind bug

What this PR does / why we need it:
Now in k8s 1.18, kubectl version will not print version if no config file is provided. See kubernetes/kubectl#853.
This problem actually has been fixed by #70713.
But after this PR #86173 is merged, it breaks the original condition.

Which issue(s) this PR fixes:

Fixes #kubernetes/kubectl#853

Special notes for your reviewer:
/cc @soltysh
/cc @brianpursley
Does this PR introduce a user-facing change?:

Fix kubectl version should print version info without config file

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

None

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 7, 2020
@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 7, 2020

/retest

1 similar comment
@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 7, 2020

/retest

@brianpursley
Copy link
Member

/retest

3 similar comments
@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 8, 2020

/retest

@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 8, 2020

/retest

@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 8, 2020

/retest

@brianpursley
Copy link
Member

/test pull-kubernetes-node-e2e-containerd

@zhouya0 zhouya0 closed this Apr 9, 2020
@zhouya0 zhouya0 reopened this Apr 9, 2020
@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 9, 2020

/retest

@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 9, 2020

Seems pull-kubernetes-node-e2e-containerd is never going to let me pass this :(

@brianpursley
Copy link
Member

Yeah, something is wrong with it. Maybe try rebasing your branch with the latest from upstream.

@zhouya0 zhouya0 force-pushed the fix_kubectl_version_should_print_version_info branch from 13f0549 to de8621a Compare April 9, 2020 01:58
@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 9, 2020

/retest

1 similar comment
@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 9, 2020

/retest

@zhouya0 zhouya0 force-pushed the fix_kubectl_version_should_print_version_info branch from de8621a to a801c1f Compare April 9, 2020 08:18
@zhouya0 zhouya0 force-pushed the fix_kubectl_version_should_print_version_info branch from 075c146 to 9172b21 Compare April 10, 2020 01:59
@zhouya0 zhouya0 requested a review from liggitt April 10, 2020 02:29
@zhouya0 zhouya0 force-pushed the fix_kubectl_version_should_print_version_info branch 2 times, most recently from 30d2990 to 5d0eb18 Compare April 10, 2020 15:48
@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 10, 2020

/retest

@liggitt
Copy link
Member

liggitt commented Apr 10, 2020

/assign @deads2k @soltysh

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Apr 10, 2020

@zhouya0: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-node-e2e-containerd 13f0549f4b013af58f2b434714605c6bd503564c link /test pull-kubernetes-node-e2e-containerd

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 11, 2020

/retest

@zhouya0
Copy link
Contributor Author

zhouya0 commented Apr 14, 2020

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 14, 2020
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

One nit and this is ok to land.

}

type emptyConfigError struct {
error
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems a bit over complicated, why not just:

type emptyConfigError struct {
    message string
}

If we need to embed error in error we'll just use go's %w when printing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just make it similar to errContextNotFound below.

@zhouya0 zhouya0 force-pushed the fix_kubectl_version_should_print_version_info branch from 5d0eb18 to 948f4de Compare April 15, 2020 14:33
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Yeah, definitely better, thx.
/lgtm
/approve
/assign @liggitt
to get client-go approval

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 15, 2020
@liggitt
Copy link
Member

liggitt commented Apr 15, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, soltysh, zhouya0

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 15, 2020
@k8s-ci-robot k8s-ci-robot merged commit db999c9 into kubernetes:master Apr 15, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Apr 15, 2020
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. release-note-none Denotes a PR that doesn't merit a release note. labels Apr 17, 2020
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. area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. 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.

6 participants