Skip to content

Commit 1f8fb79

Browse files
committed
KubeadmControlPlane status.updated should be calculated appropriately
This change makes sure that the UpToDateMachines method always returns a filter based on real data. Instead of looking at (Machines - MachinesThatNeedRollout), which excludes all machines being deleted as well, looks at all machines that match the expected configuration and aren't scheduled for a rollout. Signed-off-by: Vince Prignano <[email protected]>
1 parent 45ad7d1 commit 1f8fb79

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

controlplane/kubeadm/internal/control_plane.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,12 @@ func (c *ControlPlane) MachinesNeedingRollout() collections.Machines {
270270
// UpToDateMachines returns the machines that are up to date with the control
271271
// plane's configuration and therefore do not require rollout.
272272
func (c *ControlPlane) UpToDateMachines() collections.Machines {
273-
return c.Machines.Difference(c.MachinesNeedingRollout())
273+
return c.Machines.Filter(
274+
// Machines that shouldn't be rolled out after the deadline has expired.
275+
collections.Not(collections.ShouldRolloutAfter(&c.reconciliationTime, c.KCP.Spec.RolloutAfter)),
276+
// Machines that match with KCP config.
277+
MatchesMachineSpec(c.infraResources, c.kubeadmConfigs, c.KCP),
278+
)
274279
}
275280

276281
// getInfraResources fetches the external infrastructure resource for each machine in the collection and returns a map of machine.Name -> infraResource.

0 commit comments

Comments
 (0)