@@ -200,10 +200,6 @@ func (r *IBMPowerVSMachineReconciler) getOrCreate(scope *scope.PowerVSMachineSco
200
200
201
201
// handleLoadBalancerPoolMemberConfiguration handles loadbalancer pool member creation flow.
202
202
func (r * IBMPowerVSMachineReconciler ) handleLoadBalancerPoolMemberConfiguration (machineScope * scope.PowerVSMachineScope ) (ctrl.Result , error ) {
203
- if ! util .IsControlPlaneMachine (machineScope .Machine ) {
204
- return ctrl.Result {}, nil
205
- }
206
- machineScope .Info ("Configuring control plane machine to backend LoadBalancer pool" , "machine name" , machineScope .IBMPowerVSMachine .Name )
207
203
poolMember , err := machineScope .CreateVPCLoadBalancerPoolMember ()
208
204
if err != nil {
209
205
return ctrl.Result {}, fmt .Errorf ("failed CreateVPCLoadBalancerPoolMember %s: %w" , machineScope .IBMPowerVSMachine .Name , err )
@@ -216,6 +212,8 @@ func (r *IBMPowerVSMachineReconciler) handleLoadBalancerPoolMemberConfiguration(
216
212
}
217
213
218
214
func (r * IBMPowerVSMachineReconciler ) reconcileNormal (machineScope * scope.PowerVSMachineScope ) (ctrl.Result , error ) {
215
+ ctx := context .Background ()
216
+ log := ctrl .LoggerFrom (ctx )
219
217
machineScope .Info ("Reconciling IBMPowerVSMachine" )
220
218
221
219
if ! machineScope .Cluster .Status .InfrastructureReady {
@@ -307,8 +305,9 @@ func (r *IBMPowerVSMachineReconciler) reconcileNormal(machineScope *scope.PowerV
307
305
return ctrl.Result {}, nil
308
306
}
309
307
310
- if poolMemberReconcileResult , err := r .handleLoadBalancerPoolMemberConfiguration (machineScope ); err != nil || poolMemberReconcileResult .RequeueAfter > 0 {
311
- return poolMemberReconcileResult , err
308
+ if util .IsControlPlaneMachine (machineScope .Machine ) {
309
+ log .V (3 ).Info ("skipping loadbalancer configuration as it is not control plane machine" , "machineName" , machineScope .IBMPowerVSMachine .Name )
310
+ return r .handleLoadBalancerPoolMemberConfiguration (machineScope )
312
311
}
313
312
314
313
return ctrl.Result {}, nil
0 commit comments