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

🐛 Include machinepools in descendant count #4295

Merged

Conversation

jimmidyson
Copy link
Member

@jimmidyson jimmidyson commented Mar 11, 2021

What this PR does / why we need it:

Without this, machinepool descendeants are ignored in descendant count deletion logic and can be orphaned and unable to delete without manually deleting the finalizer.

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 #4296

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 11, 2021
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 11, 2021
@fabriziopandini
Copy link
Member

/milestone v0.4.0
This is candidate for backporting too

/lgtm
/assign @vincepri @CecileRobertMichon

@k8s-ci-robot k8s-ci-robot added this to the v0.4.0 milestone Mar 11, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 11, 2021
@@ -326,7 +326,8 @@ func (c *clusterDescendants) length() int {
return len(c.machineDeployments.Items) +
len(c.machineSets.Items) +
len(c.controlPlaneMachines.Items) +
len(c.workerMachines.Items)
len(c.workerMachines.Items) +
len(c.machinePools.Items)
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a unit test we can add to validate this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah can do, didn't notice any existing ones but I'm happy to add one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a simple unit test.

@jimmidyson jimmidyson changed the title 🐛 Include machinepools in descendent count 🐛 Include machinepools in descendant count Mar 11, 2021
Without this, machinepool descendants are ignored in deletion logic and
can be orphaned and unable to delete without manually deleting the
finalizer.
@jimmidyson jimmidyson force-pushed the machine-pool-descendants branch from 83d2b02 to 78ecded Compare March 11, 2021 20:30
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 11, 2021
@jimmidyson
Copy link
Member Author

/test pull-cluster-api-test-main

@jimmidyson
Copy link
Member Author

@fabriziopandini Yes I agree - I'd like to see this backported - this bug is affecting us in v0.3.x so a new v0.3.15 release including this fix would be really appreciated if at all possible.

@CecileRobertMichon
Copy link
Contributor

/lgtm
/approve

@jimmidyson please open a backport PR against the release-0.3 branch. Thanks for catching and fixing this!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

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 Mar 11, 2021
@k8s-ci-robot k8s-ci-robot merged commit 18029d5 into kubernetes-sigs:master Mar 11, 2021
@jimmidyson
Copy link
Member Author

@CecileRobertMichon Backported in #4299 😄

@jimmidyson jimmidyson deleted the machine-pool-descendants branch March 11, 2021 21:33
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.

MachinePool not deleted on Cluster delete
5 participants