Skip to content

Commit

Permalink
Record machine sync error event
Browse files Browse the repository at this point in the history
  • Loading branch information
vikaschoudhary16 committed Apr 9, 2019
1 parent 2d14f02 commit 7123307
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/controller/machineset/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *cluster
return reconcile.Result{}, errors.Wrap(err, "failed to update machine set status")
}

if syncErr != nil {
return reconcile.Result{}, errors.Wrapf(syncErr, "failed to sync Machineset replicas")
}

var replicas int32
if updatedMS.Spec.Replicas != nil {
replicas = *updatedMS.Spec.Replicas
Expand All @@ -263,7 +267,7 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *cluster
// 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 {

Expand Down

0 comments on commit 7123307

Please sign in to comment.