From 734154e3ea8b7892c5b70cf6b4c0de52d2e6d33f Mon Sep 17 00:00:00 2001 From: vikaschoudhary16 Date: Mon, 8 Apr 2019 15:05:28 +0530 Subject: [PATCH] UPSTREAM: <880>: openshift: Record machine sync error event --- pkg/controller/machineset/controller.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/controller/machineset/controller.go b/pkg/controller/machineset/controller.go index 3eda9126e409..48d8d3cfaa39 100644 --- a/pkg/controller/machineset/controller.go +++ b/pkg/controller/machineset/controller.go @@ -265,6 +265,10 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *machine return reconcile.Result{}, errors.Wrap(err, "failed to update machine set status") } + if syncErr != nil { + return reconcile.Result{}, errors.Wrapf(syncErr, "failed to sync machines") + } + var replicas int32 if updatedMS.Spec.Replicas != nil { replicas = *updatedMS.Spec.Replicas @@ -277,7 +281,7 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *machine // exceeds MinReadySeconds could be incorrect. // To avoid an available replica stuck in the ready state, we force a reconcile after MinReadySeconds, // at which point it should confirm any available replica to be available. - if syncErr == nil && updatedMS.Spec.MinReadySeconds > 0 && + if updatedMS.Spec.MinReadySeconds > 0 && updatedMS.Status.ReadyReplicas == replicas && updatedMS.Status.AvailableReplicas != replicas {