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

improve patch roundtripping #376

Merged
merged 1 commit into from
Mar 13, 2019

Conversation

BenTheElder
Copy link
Member

Follow up to #373

In kind versions we shipped with the v1alpha2 config the kubeadm config patches were only respected if they were on the bootstrap control plane node. this re-introduces that behavior when converting from v1alpha2 to internal.

This allows us to preserve the behavior of existing config files for now, while leaving room to introduce per-node patches that are actually used going forward.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 12, 2019
@BenTheElder
Copy link
Member Author

BenTheElder commented Mar 12, 2019

FYI @neolit123 @munnerz

This should resolve the roundtripping concerns as well, patches should roundtrip properly now where possible

for _, node := range in.Nodes {
convertedNode := Node{}
if err := Convert_config_Node_To_v1alpha2_Node(&node, &convertedNode, s); err != nil {
return err
}
// the first control plane is treated specially
Copy link
Member Author

Choose a reason for hiding this comment

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

specifically this new snippet means we roundtrip the global patches to v1alpha2

we should get people off of v1alpha2 though and we should not actually roundtrip to it, because per-node patches will NOT roundtrip correctly as they were ignored in v1alpha2

Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

SGTM
like i mentioned in the previous PR; we could have closed our eyes on this one. :)
/assign @munnerz

@BenTheElder
Copy link
Member Author

like i mentioned in the previous PR; we could have closed our eyes on this one. :)

probably, but I want to improve the patch behavior next and avoid breaking existing users 😅

@munnerz
Copy link
Member

munnerz commented Mar 13, 2019

It'll be great to get some fuzz tests in this area of the codebase at some point. I'd love to see some signal on whether we're actually getting these conversions correct or not before we starting utilising them more seriously in later api versions 😄

/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 13, 2019
@k8s-ci-robot k8s-ci-robot merged commit 93f68d9 into kubernetes-sigs:master Mar 13, 2019
@BenTheElder BenTheElder deleted the better-alpha-patch branch March 13, 2019 18:37
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. 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.

4 participants