Skip to content

Commit 6b61b81

Browse files
committed
Fix review findings
1 parent 985ac49 commit 6b61b81

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

controlplane/kubeadm/internal/control_plane.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ type ControlPlane struct {
5050
Machines collections.Machines
5151
machinesPatchHelpers map[string]*patch.Helper
5252

53-
// MachinesNotUptoDate is the source of truth for Machines that are not up-to-date.
53+
// MachinesNotUpToDate is the source of truth for Machines that are not up-to-date.
5454
// It should be used to check if a Machine is up-to-date (not machinesNotUpToDateResults).
55-
MachinesNotUptoDate collections.Machines
55+
MachinesNotUpToDate collections.Machines
5656
// machinesNotUpToDateResults is used to store the result of the UpToDate call for all Machines
5757
// (even for Machines that are up-to-date).
58-
// MachinesNotUptoDate should always be used instead to check if a Machine is up-to-date.
58+
// MachinesNotUpToDate should always be used instead to check if a Machine is up-to-date.
5959
machinesNotUpToDateResults map[string]NotUpToDateResult
6060

6161
// reconciliationTime is the time of the current reconciliation, and should be used for all "now" calculations
@@ -132,7 +132,7 @@ func NewControlPlane(ctx context.Context, managementCluster ManagementCluster, c
132132
machinesNotUptoDate.Insert(m)
133133
}
134134
// Set this even if machine is UpToDate. This is needed to complete triggering in-place updates
135-
// MachinesNotUptoDate should always be used instead to check if a Machine is up-to-date.
135+
// MachinesNotUpToDate should always be used instead to check if a Machine is up-to-date.
136136
machinesNotUpToDateResults[m.Name] = *notUpToDateResult
137137
}
138138

@@ -141,7 +141,7 @@ func NewControlPlane(ctx context.Context, managementCluster ManagementCluster, c
141141
Cluster: cluster,
142142
Machines: ownedMachines,
143143
machinesPatchHelpers: patchHelpers,
144-
MachinesNotUptoDate: machinesNotUptoDate,
144+
MachinesNotUpToDate: machinesNotUptoDate,
145145
machinesNotUpToDateResults: machinesNotUpToDateResults,
146146
KubeadmConfigs: kubeadmConfigs,
147147
InfraResources: infraMachines,
@@ -242,19 +242,19 @@ func (c *ControlPlane) GetKubeadmConfig(machineName string) (*bootstrapv1.Kubead
242242
// MachinesNeedingRollout return a list of machines that need to be rolled out.
243243
func (c *ControlPlane) MachinesNeedingRollout() (collections.Machines, map[string]NotUpToDateResult) {
244244
// Note: Machines already deleted are dropped because they will be replaced by new machines after deletion completes.
245-
return c.MachinesNotUptoDate.Filter(collections.Not(collections.HasDeletionTimestamp)), c.machinesNotUpToDateResults
245+
return c.MachinesNotUpToDate.Filter(collections.Not(collections.HasDeletionTimestamp)), c.machinesNotUpToDateResults
246246
}
247247

248248
// NotUpToDateMachines return a list of machines that are not up to date with the control
249249
// plane's configuration.
250250
func (c *ControlPlane) NotUpToDateMachines() (collections.Machines, map[string]NotUpToDateResult) {
251-
return c.MachinesNotUptoDate, c.machinesNotUpToDateResults
251+
return c.MachinesNotUpToDate, c.machinesNotUpToDateResults
252252
}
253253

254254
// UpToDateMachines returns the machines that are up to date with the control
255255
// plane's configuration.
256256
func (c *ControlPlane) UpToDateMachines() collections.Machines {
257-
return c.Machines.Difference(c.MachinesNotUptoDate)
257+
return c.Machines.Difference(c.MachinesNotUpToDate)
258258
}
259259

260260
// getInfraMachines fetches the InfraMachine for each machine in the collection and returns a map of machine.Name -> InfraMachine.

controlplane/kubeadm/internal/control_plane_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ func TestStatusToLogKeyAndValues(t *testing.T) {
341341
c := &ControlPlane{
342342
KCP: &controlplanev1.KubeadmControlPlane{},
343343
Machines: collections.FromMachines(healthyMachine, machineWithoutNode, machineJustDeleted, machineNotUpToDate, machineMarkedForRemediation),
344-
MachinesNotUptoDate: collections.FromMachines(machineNotUpToDate),
344+
MachinesNotUpToDate: collections.FromMachines(machineNotUpToDate),
345345
EtcdMembers: []*etcd.Member{{Name: "m1"}, {Name: "m2"}, {Name: "m3"}},
346346
}
347347

controlplane/kubeadm/internal/controllers/controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,8 @@ func (r *KubeadmControlPlaneReconciler) syncMachines(ctx context.Context, contro
804804
}
805805
// Note: Ensure ControlPlane has the latest version of the Machine.
806806
controlPlane.Machines[machineName] = updatedMachine
807-
if _, ok := controlPlane.MachinesNotUptoDate[machineName]; ok {
808-
controlPlane.MachinesNotUptoDate[machineName] = updatedMachine
807+
if _, ok := controlPlane.MachinesNotUpToDate[machineName]; ok {
808+
controlPlane.MachinesNotUpToDate[machineName] = updatedMachine
809809
}
810810
// Since the machine is updated, re-create the patch helper so that any subsequent
811811
// Patch calls use the correct base machine object to calculate the diffs.

0 commit comments

Comments
 (0)