Skip to content

Commit

Permalink
Merge pull request #5353 from vincepri/kcp-updated-machines-total
Browse files Browse the repository at this point in the history
🐛 KubeadmControlPlane status.updated should be calculated appropriately
  • Loading branch information
k8s-ci-robot authored Sep 28, 2021
2 parents 45ad7d1 + 1f8fb79 commit fc48062
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controlplane/kubeadm/internal/control_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,12 @@ func (c *ControlPlane) MachinesNeedingRollout() collections.Machines {
// UpToDateMachines returns the machines that are up to date with the control
// plane's configuration and therefore do not require rollout.
func (c *ControlPlane) UpToDateMachines() collections.Machines {
return c.Machines.Difference(c.MachinesNeedingRollout())
return c.Machines.Filter(
// Machines that shouldn't be rolled out after the deadline has expired.
collections.Not(collections.ShouldRolloutAfter(&c.reconciliationTime, c.KCP.Spec.RolloutAfter)),
// Machines that match with KCP config.
MatchesMachineSpec(c.infraResources, c.kubeadmConfigs, c.KCP),
)
}

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

0 comments on commit fc48062

Please sign in to comment.