Skip to content

Conversation

@bnallapeta
Copy link
Contributor

What this PR does / why we need it:
ClusterClass-managed MachinePools were not triggering node rollouts when BootstrapConfig or InfrastructureMachinePool templates changed. This happened because updateMachinePool() used reconcileReferencedObject() which patches objects in-place without changing their names. Infrastructure providers (like CAPA) watch for configRef.name changes to trigger rollouts, but since the name never changed, no rollout occurred.

This PR changes updateMachinePool() to use reconcileReferencedTemplate() instead. This is the same approach used by updateMachineDeployment().

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

/area machinepool
/area clusterclass

@k8s-ci-robot k8s-ci-robot added area/machinepool Issues or PRs related to machinepools area/clusterclass Issues or PRs related to clusterclass labels Dec 5, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign joelspeed for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 5, 2025
@bnallapeta bnallapeta marked this pull request as draft December 5, 2025 04:17
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 5, 2025
@bnallapeta
Copy link
Contributor Author

@richardcase @AndiDog
Please take a look at this. I am in the process of manually testing this and will write e2e. But, early feedback on the approach will help.

desired: desiredMP.BootstrapObject,
}); err != nil {
if createdInfra {
infrastructureMachinePoolCleanupFunc = func() {

Choose a reason for hiding this comment

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

Just curious, why are we creating an inline function instead of defining it somewhere else? Not as familiar with Kubernetes code bases so disregard if there there's a good reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/clusterclass Issues or PRs related to clusterclass area/machinepool Issues or PRs related to machinepools cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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.

ClusterClass MachinePool implementation is probably not able to rollout BootstrapConfig changes.

3 participants