Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
PanSpagetka committed Dec 9, 2024
1 parent 3294a57 commit 8dd9c18
Show file tree
Hide file tree
Showing 5 changed files with 283 additions and 61 deletions.
6 changes: 5 additions & 1 deletion exp/controllers/rosamachinepool_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func (r *ROSAMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl.Requ
if !controlPlane.Status.Ready && controlPlane.ObjectMeta.DeletionTimestamp.IsZero() {
log.Info("Control plane is not ready yet")
err := machinePoolScope.RosaMchinePoolReadyFalse(expinfrav1.WaitingForRosaControlPlaneReason, "")

return ctrl.Result{}, err
}

Expand Down Expand Up @@ -201,11 +202,12 @@ func (r *ROSAMachinePoolReconciler) reconcileNormal(ctx context.Context,
}

failureMessage, err := validateMachinePoolSpec(machinePoolScope)

if err != nil {
return ctrl.Result{}, fmt.Errorf("failed to validate ROSAMachinePool.spec: %w", err)
}

if failureMessage != nil {
machinePoolScope.RosaMachinePool.Status.FailureMessage = failureMessage
// dont' requeue because input is invalid and manual intervention is needed.
return ctrl.Result{}, nil
}
Expand All @@ -225,6 +227,7 @@ func (r *ROSAMachinePoolReconciler) reconcileNormal(ctx context.Context,
}

nodePool, found, err := ocmClient.GetNodePool(machinePoolScope.ControlPlane.Status.ID, rosaMachinePool.Spec.NodePoolName)

if err != nil {
return ctrl.Result{}, err
}
Expand Down Expand Up @@ -297,6 +300,7 @@ func (r *ROSAMachinePoolReconciler) reconcileNormal(ctx context.Context,
}

machinePoolScope.RosaMachinePool.Status.ID = nodePool.ID()

return ctrl.Result{}, nil
}

Expand Down
Loading

0 comments on commit 8dd9c18

Please sign in to comment.