@@ -272,6 +272,11 @@ func (r *ROSAMachinePoolReconciler) reconcileNormal(ctx context.Context,
272
272
273
273
nodePool , err = ocmClient .CreateNodePool (machinePoolScope .ControlPlane .Status .ID , nodePoolSpec )
274
274
if err != nil {
275
+ conditions .MarkFalse (rosaMachinePool ,
276
+ expinfrav1 .RosaMachinePoolReadyCondition ,
277
+ expinfrav1 .RosaMachinePoolReconciliationFailedReason ,
278
+ clusterv1 .ConditionSeverityError ,
279
+ "failed to create ROSAMachinePool: %s" , err .Error ())
275
280
return ctrl.Result {}, fmt .Errorf ("failed to create nodepool: %w" , err )
276
281
}
277
282
@@ -308,11 +313,7 @@ func (r *ROSAMachinePoolReconciler) reconcileDelete(
308
313
309
314
func (r * ROSAMachinePoolReconciler ) reconcileMachinePoolVersion (machinePoolScope * scope.RosaMachinePoolScope , ocmClient * ocm.Client , nodePool * cmv1.NodePool ) error {
310
315
version := machinePoolScope .RosaMachinePool .Spec .Version
311
- if version == "" {
312
- version = machinePoolScope .ControlPlane .Spec .Version
313
- }
314
-
315
- if version == rosa .RawVersionID (nodePool .Version ()) {
316
+ if version == "" || version == rosa .RawVersionID (nodePool .Version ()) {
316
317
conditions .MarkFalse (machinePoolScope .RosaMachinePool , expinfrav1 .RosaMachinePoolUpgradingCondition , "upgraded" , clusterv1 .ConditionSeverityInfo , "" )
317
318
return nil
318
319
}
@@ -370,6 +371,11 @@ func (r *ROSAMachinePoolReconciler) updateNodePool(machinePoolScope *scope.RosaM
370
371
371
372
updatedNodePool , err := ocmClient .UpdateNodePool (machinePoolScope .ControlPlane .Status .ID , nodePoolSpec )
372
373
if err != nil {
374
+ conditions .MarkFalse (machinePoolScope .RosaMachinePool ,
375
+ expinfrav1 .RosaMachinePoolReadyCondition ,
376
+ expinfrav1 .RosaMachinePoolReconciliationFailedReason ,
377
+ clusterv1 .ConditionSeverityError ,
378
+ "failed to update ROSAMachinePool: %s" , err .Error ())
373
379
return nil , fmt .Errorf ("failed to update nodePool: %w" , err )
374
380
}
375
381
0 commit comments