Skip to content

Commit b0e3658

Browse files
committed
Remove suspend process flow from create ASG
1 parent 6ebafab commit b0e3658

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

exp/controllers/awsmachinepool_controller.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ func (r *AWSMachinePoolReconciler) reconcileNormal(ctx context.Context, machineP
267267

268268
if asg == nil {
269269
// Create new ASG
270-
if _, err := r.createPool(machinePoolScope, clusterScope); err != nil {
270+
if err := r.createPool(machinePoolScope, clusterScope); err != nil {
271271
conditions.MarkFalse(machinePoolScope.AWSMachinePool, expinfrav1.ASGReadyCondition, expinfrav1.ASGProvisionFailedReason, clusterv1.ConditionSeverityError, err.Error())
272272
return ctrl.Result{}, err
273273
}
@@ -454,21 +454,17 @@ func (r *AWSMachinePoolReconciler) updatePool(machinePoolScope *scope.MachinePoo
454454
return nil
455455
}
456456

457-
func (r *AWSMachinePoolReconciler) createPool(machinePoolScope *scope.MachinePoolScope, clusterScope cloud.ClusterScoper) (*expinfrav1.AutoScalingGroup, error) {
457+
func (r *AWSMachinePoolReconciler) createPool(machinePoolScope *scope.MachinePoolScope, clusterScope cloud.ClusterScoper) error {
458458
clusterScope.Info("Initializing ASG client")
459459

460460
asgsvc := r.getASGService(clusterScope)
461461

462462
machinePoolScope.Info("Creating Autoscaling Group")
463-
asg, err := asgsvc.CreateASG(machinePoolScope)
464-
if err != nil {
465-
return nil, errors.Wrapf(err, "failed to create AWSMachinePool")
466-
}
467-
suspendedProcessesSlice := machinePoolScope.AWSMachinePool.Spec.SuspendProcesses.ConvertSetValuesToStringSlice()
468-
if err := asgsvc.SuspendProcesses(asg.Name, suspendedProcessesSlice); err != nil {
469-
return nil, errors.Wrapf(err, "failed to suspend processes while trying to create Pool")
463+
if _, err := asgsvc.CreateASG(machinePoolScope); err != nil {
464+
return errors.Wrapf(err, "failed to create AWSMachinePool")
470465
}
471-
return asg, nil
466+
467+
return nil
472468
}
473469

474470
func (r *AWSMachinePoolReconciler) findASG(machinePoolScope *scope.MachinePoolScope, asgsvc services.ASGInterface) (*expinfrav1.AutoScalingGroup, error) {

0 commit comments

Comments
 (0)