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

kubeadm: fix broken kubeadm init --config flag #48915

Merged

Conversation

mattmoyer
Copy link
Contributor

What this PR does / why we need it:
This code was changed in ea19649 (#43558) to validate that --config wasn't passed along with other flags. Unfortunately, the implementation was checking PersistentFlags(), which was not parsed at the point it was being validated.

The fix is to use Flags() instead, which contains the expected data.

Which issue this PR fixes fixes kubernetes/kubeadm#345

Special notes for your reviewer:
This is a regression that was cherry picked (#48577) into the release-1.7 branch. We should fix this before the next 1.7 point release.

This is awkward to unit test without restructuring the code. I think this command parsing code would be a good candidate for some higher level tests.

Release note:

Fix a regression that broke the `--config` flag for `kubeadm init`.

/assign @luxas

This code was changed in ea19649 to validate that `--config` wasn't passed along with other flags. Unfortunately, the implementation was checking `PersistentFlags()`, which was not parsed at the point it was being validated. The result was that `--config` was _always_ rejected, not just when it was specified alongside other flags.

The fix is to use `Flags()` instead, which contains the expected data.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 13, 2017
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jul 13, 2017
@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 Jul 13, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @mattmoyer. 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.

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

@mattmoyer
Copy link
Contributor Author

We need to cherry pick this onto release-1.7 to avoid a regression between 1.7.0 and 1.7.1 (unreleased).

@luxas
Copy link
Member

luxas commented Jul 14, 2017

/ok-to-test
/lgtm
@wojtek-t unfortunate, but we have to cherrypick this to v1.7.1. PTAL

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 14, 2017
@luxas luxas added this to the v1.7 milestone Jul 14, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: luxas, mattmoyer

Associated issue: 345

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

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

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

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

@luxas - 1.7.1 is already released. It's too late to modify 1.7.1 ...

@wojtek-t
Copy link
Member

There was some accelerated 1.7.1 release that I wasn't really involved into.
That said, there will be 1.7.2 that I will cut next week and I will keep this PR in mind.

@luxas
Copy link
Member

luxas commented Jul 14, 2017

There was some accelerated 1.7.1 release that I wasn't really involved into.

Oh, hadn't noticed that. Well, ok.

That said, there will be 1.7.2 that I will cut next week and I will keep this PR in mind.

Thanks!

@luxas
Copy link
Member

luxas commented Jul 14, 2017

/retest

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit b664aeb into kubernetes:master Jul 14, 2017
@wojtek-t wojtek-t added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Jul 14, 2017
k8s-github-robot pushed a commit that referenced this pull request Jul 17, 2017
…915-upstream-release-1.7

Automatic merge from submit-queue

Automated cherry pick of #48915

Cherry pick of #48915 on release-1.7.

#48915: kubeadm: fix broken `kubeadm init --config` flag.
@k8s-cherrypick-bot
Copy link

Commit found in the "release-1.7" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked.

@mattmoyer mattmoyer deleted the fix-kubeadm-config-regression branch July 17, 2017 19:53
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. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. 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/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.

kubeadm init --config is broken
8 participants