MachineDeployment loses track of MachineSet when labels change #1341
Labels
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/active
Indicates that an issue or PR is actively being worked on by a contributor.
priority/important-soon
Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone
/kind bug
What steps did you take and what happened:
Given a MachineDeployment:
I added (via
kubectl edit
) a label to both theselector
and thetemplate
:The MachineDeployment controller created a new MachineSet matching the new template and scaled it up to the appropriate number of replicas, but never scaled down the old MachineSet.
What did you expect to happen:
waves hands the deploy to have completed successfully, respecting whatever rolling update strategy is configured (I was testing with a single replica, but I would be surprised if it followed the strategy).
I think the way the Deployment controller works is to use the owner ref to infer that the old ReplicaSet is still part of the same "deployment": https://github.com/kubernetes/kubernetes/blob/06dc8cf4cb0d3bdc7b718392a66ca82678d9982f/pkg/controller/deployment/deployment_controller.go#L498-L499
Anything else you would like to add:
I haven't done a thorough look yet, but it seems like we might be able to add a "is controlled by this machinedeployment -> append to filtered" block before we check the label selector here:
cluster-api/controllers/machinedeployment_controller.go
Line 196 in e8858ef
Environment:
The text was updated successfully, but these errors were encountered: