Skip to content

Commit fc48062

Browse files
authored
Merge pull request #5353 from vincepri/kcp-updated-machines-total
🐛 KubeadmControlPlane status.updated should be calculated appropriately
2 parents 45ad7d1 + 1f8fb79 commit fc48062

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)