@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414limitations under the License.
1515*/
1616
17- package controllers
17+ package machinepool
1818
1919import (
2020 "context"
@@ -53,7 +53,7 @@ import (
5353 "sigs.k8s.io/cluster-api/util/predicates"
5454)
5555
56- func (r * MachinePoolReconciler ) reconcilePhase (mp * expv1.MachinePool ) {
56+ func (r * Reconciler ) reconcilePhase (mp * expv1.MachinePool ) {
5757 // Set the phase to "pending" if nil.
5858 if mp .Status .Phase == "" {
5959 mp .Status .SetTypedPhase (expv1 .MachinePoolPhasePending )
@@ -108,7 +108,7 @@ func (r *MachinePoolReconciler) reconcilePhase(mp *expv1.MachinePool) {
108108}
109109
110110// reconcileExternal handles generic unstructured objects referenced by a MachinePool.
111- func (r * MachinePoolReconciler ) reconcileExternal (ctx context.Context , m * expv1.MachinePool , ref * corev1.ObjectReference ) (external.ReconcileOutput , error ) {
111+ func (r * Reconciler ) reconcileExternal (ctx context.Context , m * expv1.MachinePool , ref * corev1.ObjectReference ) (external.ReconcileOutput , error ) {
112112 log := ctrl .LoggerFrom (ctx )
113113
114114 if err := utilconversion .UpdateReferenceAPIContract (ctx , r .Client , ref ); err != nil {
@@ -185,7 +185,7 @@ func (r *MachinePoolReconciler) reconcileExternal(ctx context.Context, m *expv1.
185185}
186186
187187// reconcileBootstrap reconciles the Spec.Bootstrap.ConfigRef object on a MachinePool.
188- func (r * MachinePoolReconciler ) reconcileBootstrap (ctx context.Context , s * scope ) (ctrl.Result , error ) {
188+ func (r * Reconciler ) reconcileBootstrap (ctx context.Context , s * scope ) (ctrl.Result , error ) {
189189 log := ctrl .LoggerFrom (ctx )
190190 m := s .machinePool
191191 // Call generic external reconciler if we have an external reference.
@@ -264,7 +264,7 @@ func (r *MachinePoolReconciler) reconcileBootstrap(ctx context.Context, s *scope
264264}
265265
266266// reconcileInfrastructure reconciles the Spec.InfrastructureRef object on a MachinePool.
267- func (r * MachinePoolReconciler ) reconcileInfrastructure (ctx context.Context , s * scope ) (ctrl.Result , error ) {
267+ func (r * Reconciler ) reconcileInfrastructure (ctx context.Context , s * scope ) (ctrl.Result , error ) {
268268 log := ctrl .LoggerFrom (ctx )
269269 cluster := s .cluster
270270 mp := s .machinePool
@@ -374,7 +374,7 @@ func (r *MachinePoolReconciler) reconcileInfrastructure(ctx context.Context, s *
374374// infrastructure is created accordingly.
375375// Note: When supported by the cloud provider implementation of the MachinePool, machines will provide a means to interact
376376// with the corresponding infrastructure (e.g. delete a specific machine in case MachineHealthCheck detects it is unhealthy).
377- func (r * MachinePoolReconciler ) reconcileMachines (ctx context.Context , s * scope , infraMachinePool * unstructured.Unstructured ) error {
377+ func (r * Reconciler ) reconcileMachines (ctx context.Context , s * scope , infraMachinePool * unstructured.Unstructured ) error {
378378 log := ctrl .LoggerFrom (ctx )
379379 mp := s .machinePool
380380
@@ -431,7 +431,7 @@ func (r *MachinePoolReconciler) reconcileMachines(ctx context.Context, s *scope,
431431}
432432
433433// createOrUpdateMachines creates a MachinePool Machine for each infraMachine if it doesn't already exist and sets the owner reference and infraRef.
434- func (r * MachinePoolReconciler ) createOrUpdateMachines (ctx context.Context , s * scope , machines []clusterv1.Machine , infraMachines []unstructured.Unstructured ) error {
434+ func (r * Reconciler ) createOrUpdateMachines (ctx context.Context , s * scope , machines []clusterv1.Machine , infraMachines []unstructured.Unstructured ) error {
435435 log := ctrl .LoggerFrom (ctx )
436436
437437 // Construct a set of names of infraMachines that already have a Machine.
@@ -490,7 +490,7 @@ func (r *MachinePoolReconciler) createOrUpdateMachines(ctx context.Context, s *s
490490
491491// computeDesiredMachine constructs the desired Machine for an infraMachine.
492492// If the Machine exists, it ensures the Machine always owned by the MachinePool.
493- func (r * MachinePoolReconciler ) computeDesiredMachine (mp * expv1.MachinePool , infraMachine * unstructured.Unstructured , existingMachine * clusterv1.Machine , existingNode * corev1.Node ) * clusterv1.Machine {
493+ func (r * Reconciler ) computeDesiredMachine (mp * expv1.MachinePool , infraMachine * unstructured.Unstructured , existingMachine * clusterv1.Machine , existingNode * corev1.Node ) * clusterv1.Machine {
494494 infraRef := corev1.ObjectReference {
495495 APIVersion : infraMachine .GetAPIVersion (),
496496 Kind : infraMachine .GetKind (),
@@ -546,7 +546,7 @@ func (r *MachinePoolReconciler) computeDesiredMachine(mp *expv1.MachinePool, inf
546546
547547// infraMachineToMachinePoolMapper is a mapper function that maps an InfraMachine to the MachinePool that owns it.
548548// This is used to trigger an update of the MachinePool when a InfraMachine is changed.
549- func (r * MachinePoolReconciler ) infraMachineToMachinePoolMapper (ctx context.Context , o client.Object ) []ctrl.Request {
549+ func (r * Reconciler ) infraMachineToMachinePoolMapper (ctx context.Context , o client.Object ) []ctrl.Request {
550550 log := ctrl .LoggerFrom (ctx )
551551
552552 if labels .IsMachinePoolOwned (o ) {
@@ -570,7 +570,7 @@ func (r *MachinePoolReconciler) infraMachineToMachinePoolMapper(ctx context.Cont
570570 return nil
571571}
572572
573- func (r * MachinePoolReconciler ) waitForMachineCreation (ctx context.Context , machineList []clusterv1.Machine ) error {
573+ func (r * Reconciler ) waitForMachineCreation (ctx context.Context , machineList []clusterv1.Machine ) error {
574574 _ = ctrl .LoggerFrom (ctx )
575575
576576 // waitForCacheUpdateTimeout is the amount of time allowed to wait for desired state.
@@ -602,7 +602,7 @@ func (r *MachinePoolReconciler) waitForMachineCreation(ctx context.Context, mach
602602 return nil
603603}
604604
605- func (r * MachinePoolReconciler ) getNodeRefMap (ctx context.Context , c client.Client ) (map [string ]* corev1.Node , error ) {
605+ func (r * Reconciler ) getNodeRefMap (ctx context.Context , c client.Client ) (map [string ]* corev1.Node , error ) {
606606 log := ctrl .LoggerFrom (ctx )
607607 nodeRefsMap := make (map [string ]* corev1.Node )
608608 nodeList := corev1.NodeList {}
0 commit comments