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

🐛 KCP: Allow unsetting fields if their child fields are mutable #8037

Merged

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Feb 1, 2023

Signed-off-by: Stefan Büringer buringerst@vmware.com

What this PR does / why we need it:
This PR makes parent fields mutable if there fields already are.

An example is that it was possible to modify rolloutBefore.certificatesExpiryDays but not to unset rolloutBefore.

I did this for all fields as I think we want to allow to unset all of them. In some cases it's theoretically not necessary because when the field is unset either it's marshalled as an empty object or defaulting is run. But I think it's easier to make them all mutable instead of documenting the various cases.

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 #

Signed-off-by: Stefan Büringer buringerst@vmware.com
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 1, 2023
@sbueringer
Copy link
Member Author

/cherry-pick release-1.3

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 1, 2023
@k8s-infra-cherrypick-robot

@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.3 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.3

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.

@randomvariable
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 1, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: d0dc9cf13fd16d6744a5460eb8d371e3dc8afe8a

Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

@ykakarap ykakarap left a comment

Choose a reason for hiding this comment

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

/lgtm

Do we also need to cherry-pick this back to release-1.2. release-1.2 does not have the rolloutBefore field but does it still apply for the other fields?

@sbueringer
Copy link
Member Author

Good idea. Let's do it. Don't want to deal with this problem again

@sbueringer
Copy link
Member Author

/cherry-pick release-1.2

@k8s-infra-cherrypick-robot

@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.2 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.2

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.

@sbueringer
Copy link
Member Author

(just to get notified)

Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

/rename bug KCP: Allow unsetting fields if their child fields are mutable

@killianmuldoon
Copy link
Contributor

/retitle 🐛 KCP: Allow unsetting fields if their child fields are mutable

@k8s-ci-robot k8s-ci-robot changed the title 🐛 KCP: Allow unsetting fields if there childs are mutable 🐛 KCP: Allow unsetting fields if their child fields are mutable Feb 3, 2023
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 Feb 7, 2023
@k8s-ci-robot k8s-ci-robot merged commit ddd6c44 into kubernetes-sigs:main Feb 7, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Feb 7, 2023
@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #8081

In response to this:

/cherry-pick release-1.3

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.

@k8s-infra-cherrypick-robot

@sbueringer: #8037 failed to apply on top of branch "release-1.2":

Applying: KCP: Allow unsetting fields if there childs are mutable
Using index info to reconstruct a base tree...
M	controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go
M	controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go
Falling back to patching base and 3-way merge...
Auto-merging controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go
CONFLICT (content): Merge conflict in controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go
Auto-merging controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go
CONFLICT (content): Merge conflict in controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 KCP: Allow unsetting fields if there childs are mutable
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.2

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.

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/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.

None yet

7 participants