@@ -51,12 +51,12 @@ type ControlPlane struct {
5151 machinesPatchHelpers map [string ]* patch.Helper
5252
5353 // MachinesNotUpToDate is the source of truth for Machines that are not up-to-date.
54- // It should be used to check if a Machine is up-to-date (not machinesNotUpToDateResults ).
54+ // It should be used to check if a Machine is up-to-date (not machinesUpToDateResults ).
5555 MachinesNotUpToDate collections.Machines
56- // machinesNotUpToDateResults is used to store the result of the UpToDate call for all Machines
56+ // machinesUpToDateResults is used to store the result of the UpToDate call for all Machines
5757 // (even for Machines that are up-to-date).
5858 // MachinesNotUpToDate should always be used instead to check if a Machine is up-to-date.
59- machinesNotUpToDateResults map [string ]NotUpToDateResult
59+ machinesUpToDateResults map [string ]UpToDateResult
6060
6161 // reconciliationTime is the time of the current reconciliation, and should be used for all "now" calculations
6262 reconciliationTime metav1.Time
@@ -122,9 +122,9 @@ func NewControlPlane(ctx context.Context, managementCluster ManagementCluster, c
122122 // Select machines that should be rolled out because of an outdated configuration or because rolloutAfter/Before expired.
123123 reconciliationTime := metav1 .Now ()
124124 machinesNotUptoDate := make (collections.Machines , len (ownedMachines ))
125- machinesNotUpToDateResults := map [string ]NotUpToDateResult {}
125+ machinesUpToDateResults := map [string ]UpToDateResult {}
126126 for _ , m := range ownedMachines {
127- upToDate , notUpToDateResult , err := UpToDate (ctx , client , cluster , m , kcp , & reconciliationTime , infraMachines , kubeadmConfigs )
127+ upToDate , upToDateResult , err := UpToDate (ctx , client , cluster , m , kcp , & reconciliationTime , infraMachines , kubeadmConfigs )
128128 if err != nil {
129129 return nil , err
130130 }
@@ -133,20 +133,20 @@ func NewControlPlane(ctx context.Context, managementCluster ManagementCluster, c
133133 }
134134 // Set this even if machine is UpToDate. This is needed to complete triggering in-place updates
135135 // MachinesNotUpToDate should always be used instead to check if a Machine is up-to-date.
136- machinesNotUpToDateResults [m .Name ] = * notUpToDateResult
136+ machinesUpToDateResults [m .Name ] = * upToDateResult
137137 }
138138
139139 return & ControlPlane {
140- KCP : kcp ,
141- Cluster : cluster ,
142- Machines : ownedMachines ,
143- machinesPatchHelpers : patchHelpers ,
144- MachinesNotUpToDate : machinesNotUptoDate ,
145- machinesNotUpToDateResults : machinesNotUpToDateResults ,
146- KubeadmConfigs : kubeadmConfigs ,
147- InfraResources : infraMachines ,
148- reconciliationTime : reconciliationTime ,
149- managementCluster : managementCluster ,
140+ KCP : kcp ,
141+ Cluster : cluster ,
142+ Machines : ownedMachines ,
143+ machinesPatchHelpers : patchHelpers ,
144+ MachinesNotUpToDate : machinesNotUptoDate ,
145+ machinesUpToDateResults : machinesUpToDateResults ,
146+ KubeadmConfigs : kubeadmConfigs ,
147+ InfraResources : infraMachines ,
148+ reconciliationTime : reconciliationTime ,
149+ managementCluster : managementCluster ,
150150 }, nil
151151}
152152
@@ -240,15 +240,15 @@ func (c *ControlPlane) GetKubeadmConfig(machineName string) (*bootstrapv1.Kubead
240240}
241241
242242// MachinesNeedingRollout return a list of machines that need to be rolled out.
243- func (c * ControlPlane ) MachinesNeedingRollout () (collections.Machines , map [string ]NotUpToDateResult ) {
243+ func (c * ControlPlane ) MachinesNeedingRollout () (collections.Machines , map [string ]UpToDateResult ) {
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 .machinesUpToDateResults
246246}
247247
248248// NotUpToDateMachines return a list of machines that are not up to date with the control
249249// plane's configuration.
250- func (c * ControlPlane ) NotUpToDateMachines () (collections.Machines , map [string ]NotUpToDateResult ) {
251- return c .MachinesNotUpToDate , c .machinesNotUpToDateResults
250+ func (c * ControlPlane ) NotUpToDateMachines () (collections.Machines , map [string ]UpToDateResult ) {
251+ return c .MachinesNotUpToDate , c .machinesUpToDateResults
252252}
253253
254254// UpToDateMachines returns the machines that are up to date with the control
0 commit comments