@@ -379,10 +379,11 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
379379 if err != nil || ! provResult .IsProvisioned {
380380 return ctrl.Result {}, err
381381 }
382+ instance .Status .BmhRefHash = provResult .BmhRefHash
382383 }
383384
384385 isDeploymentReady , isDeploymentRunning , isDeploymentFailed , failedDeployment , err := checkDeployment (
385- ctx , helper , instance , provResult . BmhRefHash )
386+ ctx , helper , instance )
386387 if ! isDeploymentFailed && err != nil {
387388 instance .Status .Conditions .MarkFalse (
388389 condition .DeploymentReadyCondition ,
@@ -426,7 +427,7 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
426427 Log .Info ("Set NodeSet DeploymentReadyCondition true" )
427428 instance .Status .Conditions .MarkTrue (condition .DeploymentReadyCondition ,
428429 condition .DeploymentReadyMessage )
429- instance .Status .DeployedBmhHash = provResult .BmhRefHash
430+ instance .Status .DeployedBmhHash = instance . Status .BmhRefHash
430431 } else if isDeploymentRunning {
431432 Log .Info ("Deployment still running..." , "instance" , instance )
432433 Log .Info ("Set NodeSet DeploymentReadyCondition false" )
@@ -462,7 +463,6 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
462463
463464func checkDeployment (ctx context.Context , helper * helper.Helper ,
464465 instance * dataplanev1.OpenStackDataPlaneNodeSet ,
465- bmhRefHash string ,
466466) (bool , bool , bool , string , error ) {
467467 // Get all completed deployments
468468 var failedDeployment string
@@ -520,8 +520,8 @@ func checkDeployment(ctx context.Context, helper *helper.Helper,
520520 // If the nodeset configHash does not match with what's in the deployment or
521521 // deployedBmhHash is different from current bmhRefHash.
522522 if (deployment .Status .NodeSetHashes [instance .Name ] != instance .Status .ConfigHash ) ||
523- (! instance .Spec .PreProvisioned && instance . Status . DeployedBmhHash != "" &&
524- instance .Status .DeployedBmhHash != bmhRefHash ) {
523+ (! instance .Spec .PreProvisioned &&
524+ deployment .Status .BmhRefHashes [ instance . Name ] != instance . Status . BmhRefHash ) {
525525 continue
526526 }
527527 isDeploymentReady = true
0 commit comments