From e5070623740a923a0e2f6dac780c74c2abc2ce7d Mon Sep 17 00:00:00 2001 From: vikaschoudhary16 Date: Mon, 8 Apr 2019 12:27: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 550655d895ef..c75f5800a1ad 100644 --- a/pkg/controller/machineset/controller.go +++ b/pkg/controller/machineset/controller.go @@ -205,6 +205,10 @@ func (r *ReconcileMachineSet) Reconcile(request reconcile.Request) (reconcile.Re 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 @@ -217,7 +221,7 @@ func (r *ReconcileMachineSet) Reconcile(request reconcile.Request) (reconcile.Re // 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 {