diff --git a/controllers/novaconductor_controller.go b/controllers/novaconductor_controller.go index 44ab49312..98784c842 100644 --- a/controllers/novaconductor_controller.go +++ b/controllers/novaconductor_controller.go @@ -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 diff --git a/controllers/novascheduler_controller.go b/controllers/novascheduler_controller.go index d5a02ae41..0de053581 100644 --- a/controllers/novascheduler_controller.go +++ b/controllers/novascheduler_controller.go @@ -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 }