Skip to content

🐛 Mitigate managedFields apiserver issue for SSA#13338

Open
sbueringer wants to merge 1 commit intokubernetes-sigs:mainfrom
sbueringer:pr-repro-managed-fields
Open

🐛 Mitigate managedFields apiserver issue for SSA#13338
sbueringer wants to merge 1 commit intokubernetes-sigs:mainfrom
sbueringer:pr-repro-managed-fields

Conversation

@sbueringer
Copy link
Member

@sbueringer sbueringer commented Feb 16, 2026

What this PR does / why we need it:

Through an issue in kube-apiserver (kubernetes/kubernetes#136919) it can happen that managedFields of objects are dropped.

This is problematic for cases where core CAPI is using SSA to continuously update objects.

This PR mitigates this issue by restoring managedFields for all cases where we use SSA.

Once the issue is fixed in kube-apiserver and our min supported version matches accordingly we can remove this code again.

The following objects are affected:

For classy clusters:

  • Cluster
  • InfraCluster
  • ControlPlane
  • MachineDeployment, MachinePool, MachineHealthCheck
  • BootstrapConfigTemplate, InfraMachineTemplate
  • BootstrapConfig, InfraMachinePoolTemplate

For all clusters:

  • MachineSets
  • Machines, BootstrapConfig, InfraMachine (managed by KCP + MS)

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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-area PR is missing an area label labels Feb 16, 2026
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 16, 2026
@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 justinsb for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 16, 2026
@sbueringer sbueringer force-pushed the pr-repro-managed-fields branch from 2d4bdda to 35e6d96 Compare February 16, 2026 11:56
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 16, 2026
@sbueringer sbueringer force-pushed the pr-repro-managed-fields branch from 35e6d96 to 05e34a3 Compare February 16, 2026 11:59
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 16, 2026
@sbueringer sbueringer force-pushed the pr-repro-managed-fields branch 2 times, most recently from 094ac30 to 9ada25b Compare February 16, 2026 17:13
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main-gke

@sbueringer sbueringer force-pushed the pr-repro-managed-fields branch 3 times, most recently from a9518f8 to e1f05f6 Compare February 17, 2026 10:22
@sbueringer sbueringer force-pushed the pr-repro-managed-fields branch 3 times, most recently from 39c5c8b to efccec0 Compare February 17, 2026 11:07
@sbueringer sbueringer changed the title [WIP] 🐛 Mitigate managedFields apiserver issue for SSA 🐛 Mitigate managedFields apiserver issue for SSA Feb 17, 2026
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 17, 2026
Signed-off-by: Stefan Büringer buringerst@vmware.com
@sbueringer sbueringer force-pushed the pr-repro-managed-fields branch from efccec0 to 11817f5 Compare February 17, 2026 12:03
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main-gke

@k8s-ci-robot
Copy link
Contributor

@sbueringer: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-e2e-main-gke 11817f5 link true /test pull-cluster-api-e2e-main-gke

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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-sigs/prow repository. I understand the commands that are listed here.

@sbueringer sbueringer added area/clusterclass Issues or PRs related to clusterclass area/provider/control-plane-kubeadm Issues or PRs related to KCP area/machineset Issues or PRs related to machinesets area/machinedeployment Issues or PRs related to machinedeployments labels Feb 17, 2026
@k8s-ci-robot k8s-ci-robot removed do-not-merge/needs-area PR is missing an area label labels Feb 17, 2026
func (r *Reconciler) reconcileDelete(ctx context.Context, s *scope) (ctrl.Result, error) {
machineSet := s.machineSet
machineList := s.machines
if !s.getAndAdoptMachinesForMachineSetSucceeded {
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 was thinking about getting rid of getAndAdoptMachinesForMachineSetSucceeded (and the same field in the MD controller) in a follow-up. But we cannot do that because there is still code that has to check for it

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/machinedeployment Issues or PRs related to machinedeployments area/machineset Issues or PRs related to machinesets area/provider/control-plane-kubeadm Issues or PRs related to KCP cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants