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 mutation of all fields that should be mutable #9871

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

sbueringer
Copy link
Member

Signed-off-by: Stefan Büringer [email protected]

What this PR does / why we need it:
I went over the entire KCP struct and audited for fields that can be mutated.

The goal was to avoid further PRs to make more fields mutable only after someone hit a problem

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 #

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label labels Dec 13, 2023
@sbueringer
Copy link
Member Author

/cherry-pick release-1.6

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

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

In response to this:

/cherry-pick release-1.6

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

/cherry-pick release-1.5

@k8s-infra-cherrypick-robot

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

In response to this:

/cherry-pick release-1.5

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

/assign @fabriziopandini

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 13, 2023
@@ -726,12 +718,6 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
before: before,
kcp: validUpdate,
},
{
name: "should return error when trying to mutate the kubeadmconfigspec initconfiguration",
Copy link
Member Author

Choose a reason for hiding this comment

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

Now all fields in initconfiguration and joinconfiguration are mutable. This test effectively tested before that it wasn't possible to mutate some of the fields

@@ -912,20 +892,20 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
kcp: featureGates,
},
{
Copy link
Member Author

Choose a reason for hiding this comment

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

Happy to make some of these etcd fields immutable again. I just don't understand why it shouldn't be possible to mutate them.

Does anyone have more context? @fabriziopandini @vincepri maybe?

Copy link
Member

Choose a reason for hiding this comment

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

no specific reason AFAIK. we just started with everything immutable and relaxed things slowly

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand that in general we added new mutable fields iteratively. I got confused that we explicitly had unit tests ensuring that these fields are immutable

@@ -947,12 +927,6 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
before: etcdLocalImageTag,
kcp: unsetEtcd,
},
{
name: "should fail when modifying a field that is not the local etcd image metadata",
Copy link
Member Author

Choose a reason for hiding this comment

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

This test is duplicate to the one above

@fabriziopandini fabriziopandini changed the title 🌱 KCP: Allow mutation of all fields that should be mutable ✨ KCP: Allow mutation of all fields that should be mutable Dec 13, 2023
@fabriziopandini
Copy link
Member

/area control-plane
/lgtm

changes the PR type so it stands out in the release notes

@k8s-ci-robot k8s-ci-robot added area/control-plane Issues or PRs related to control-plane lifecycle management lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/needs-area PR is missing an area label labels Dec 13, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 91fd99343e43152d237849031a93656e83b29552

@sbueringer
Copy link
Member Author

/assign @vincepri @chrischdi @enxebre

@fabriziopandini
Copy link
Member

/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 Dec 15, 2023
@k8s-ci-robot k8s-ci-robot merged commit 2d58e1c into kubernetes-sigs:main Dec 15, 2023
27 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.7 milestone Dec 15, 2023
@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #9884

In response to this:

/cherry-pick release-1.5

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: new pull request created: #9885

In response to this:

/cherry-pick release-1.6

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. area/control-plane Issues or PRs related to control-plane lifecycle management 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.

None yet

7 participants