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

🐛 ClusterClass: fix reconciliation of MD delete #7403

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Oct 13, 2022

What this PR does / why we need it:
Currently it is not possible to delete MachineDeployments via Cluster.spec.topology,
because the code in current state assumes that for an existing MachineDeployment there is still an entry in Cluster.spec.topology.workers.

This was introduced in #7231 and thus v1.2 and main is affected

Follow-up:

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 the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 13, 2022
@sbueringer
Copy link
Member Author

/assign @fabriziopandini @killianmuldoon

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 13, 2022
@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.

@killianmuldoon
Copy link
Contributor

Follow-up to have this covered in some e2e test, or maybe just an integration test would work.

@killianmuldoon
Copy link
Contributor

Fix is working for me, it also fixes clusters in a bad state from an upgrade from v1.2.3. i.e.
-> Delete machineDeploymentTopology in v1.2.3
-> See error in logs and failed deletion
-> Update CAPI controller to this PR
-> Topology properly reconciled
-> Adding and removing new MD topologies works as expected after this recovery.

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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 13, 2022
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 13, 2022
@sbueringer
Copy link
Member Author

sbueringer commented Oct 13, 2022

I'll open an issue to extend the clusterclass changes e2e test to delete the MD we have at the end and verify that it's gone. Should be a straight-forward change and shouldn't even take longer, given that we have to delete the whole Cluster anyway.

EDIT: Done: #7404

@fabriziopandini
Copy link
Member

Thanks for the quick fix, IMO this is worth an extra patch release sometime beginning next week
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 13, 2022
@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 Oct 13, 2022
@k8s-ci-robot k8s-ci-robot merged commit 8c4f8ac into kubernetes-sigs:main Oct 13, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.3 milestone Oct 13, 2022
@k8s-infra-cherrypick-robot

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

Applying: ClusterClass: fix reconciliation of MD delete
Using index info to reconstruct a base tree...
M	internal/controllers/topology/cluster/current_state.go
M	internal/controllers/topology/cluster/current_state_test.go
Falling back to patching base and 3-way merge...
Auto-merging internal/controllers/topology/cluster/current_state_test.go
Auto-merging internal/controllers/topology/cluster/current_state.go
CONFLICT (content): Merge conflict in internal/controllers/topology/cluster/current_state.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 ClusterClass: fix reconciliation of MD delete
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.

@sbueringer sbueringer deleted the pr-fix-md-delete branch October 13, 2022 14:32
@sbueringer
Copy link
Member Author

I'll open a cherry-pick PR

@sbueringer
Copy link
Member Author

Thx @killianmuldoon for the additional testing!!

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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants