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 roundtrip conversions between v1alpha2 and v1alpha3 #2074

Merged
merged 2 commits into from
Oct 29, 2020

Conversation

sedefsavas
Copy link
Contributor

What this PR does / why we need it:

This PR prevents overriding ControlPlaneLoadBalancer and Bastion changes.
It also avoids creating CloudInit during the conversion if it is empty, because if we create an empty CloudInit during conversion,
out.EnableSecureSecretsManager = !in.InsecureSkipSecretsManager sets a field that should not be there.
``

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2059

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 27, 2020
@k8s-ci-robot k8s-ci-robot requested review from justinsb and ncdc October 27, 2020 17:12
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 27, 2020
@sedefsavas
Copy link
Contributor Author

cc @ncdc

@randomvariable
Copy link
Member

Are there some tests we could add that would have picked up on the issues?

@ncdc
Copy link
Contributor

ncdc commented Oct 27, 2020

@randomvariable yes, we need to make the change in CAPI though

@sedefsavas
Copy link
Contributor Author

sedefsavas commented Oct 27, 2020

Added a reverse fuzz test: kubernetes-sigs/cluster-api#3877

I could add individual tests as well for the 3 fields I changed here.

@randomvariable
Copy link
Member

If an upstream CAPI change is going to deal with it, that's fine.

/lgtm

I'll leave @ncdc to do the approve given the greater context you have.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 28, 2020
if restored.CloudInit.SecureSecretsBackend != "" {
if src.CloudInit != nil {
dst.CloudInit.SecureSecretsBackend = restored.CloudInit.SecureSecretsBackend
}
Copy link
Member

Choose a reason for hiding this comment

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

Back when I added the secure secrets stuff, I had originally also added
image before removing it thinking it was excessive.

Do we in fact need to conditionally restore the SecretARN here too?

Copy link
Contributor

Choose a reason for hiding this comment

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

SecretARN turned into SecretPrefix + SecretCount.

Copy link
Contributor

Choose a reason for hiding this comment

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

And SecretPrefix + SecretCount exist in both a2 and a3

@randomvariable
Copy link
Member

/retitle Fix roundtrip conversions between v1alpha2 and v1alpha3
/approve

@k8s-ci-robot k8s-ci-robot changed the title 🐛 Fixes in conversions Fix roundtrip conversions between v1alpha2 and v1alpha3 Oct 29, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: randomvariable

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 Oct 29, 2020
@randomvariable randomvariable added this to the v0.6.2 milestone Oct 29, 2020
@k8s-ci-robot k8s-ci-robot merged commit a25a8be into kubernetes-sigs:master Oct 29, 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. 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.

v1alpha2/v1alpha3 skew - Bastion does not have Public IP in AWSCluster status
4 participants