Skip to content

Commit

Permalink
normalize the deployment ready check
Browse files Browse the repository at this point in the history
Replace spec replica count with readycount check
  • Loading branch information
auniyal61 authored and openshift-merge-bot[bot] committed Jun 20, 2024
1 parent e9f5a93 commit 7a69b24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions controllers/novaconductor_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ func (r *NovaConductorReconciler) Reconcile(ctx context.Context, req ctrl.Reques
return ctrl.Result{}, err
}

if *instance.Spec.Replicas != instance.Status.ReadyCount {
Log.Info("Waiting for the ReadyCount to become equal to Replicas before doing service cleanup in nova database.")
if !instance.Status.Conditions.IsTrue(condition.DeploymentReadyCondition) {
Log.Info("Waiting for the deployment to be ready before doing service cleanup in the nova database.")

return ctrl.Result{}, nil
}
// clean up nova services from nova db should be always a last step in reconcile
Expand Down
5 changes: 3 additions & 2 deletions controllers/novascheduler_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,9 @@ func (r *NovaSchedulerReconciler) Reconcile(ctx context.Context, req ctrl.Reques
return result, err
}

if *instance.Spec.Replicas != instance.Status.ReadyCount {
Log.Info("Waiting for the ReadyCount to become equal to Replicas before doing service cleanup in nova database.")
if !instance.Status.Conditions.IsTrue(condition.DeploymentReadyCondition) {
Log.Info("Waiting for the deployment to be ready before doing service cleanup in the nova database.")

return ctrl.Result{}, nil
}

Expand Down

0 comments on commit 7a69b24

Please sign in to comment.