Skip to content

Commit

Permalink
new is not a good name since new() is a buildin function in golang
Browse files Browse the repository at this point in the history
  • Loading branch information
polefishu committed Jan 19, 2020
1 parent c38053a commit 58901e9
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ func (r *ReconcileDistributedRedisCluster) Reconcile(request reconcile.Request)
return reconcile.Result{}, nil
}
reqLogger.WithValues("err", err).Info("ensureCluster")
new := instance.Status.DeepCopy()
SetClusterScaling(new, err.Error())
r.updateClusterIfNeed(instance, new, reqLogger)
newStatus := instance.Status.DeepCopy()
SetClusterScaling(newStatus, err.Error())
r.updateClusterIfNeed(instance, newStatus, reqLogger)
return reconcile.Result{RequeueAfter: requeueAfter}, nil
}

Expand All @@ -202,9 +202,9 @@ func (r *ReconcileDistributedRedisCluster) Reconcile(request reconcile.Request)
return reconcile.Result{}, err
}
reqLogger.WithValues("err", err).Info("waitPodReady")
new := instance.Status.DeepCopy()
SetClusterScaling(new, err.Error())
r.updateClusterIfNeed(instance, new, reqLogger)
newStatus := instance.Status.DeepCopy()
SetClusterScaling(newStatus, err.Error())
r.updateClusterIfNeed(instance, newStatus, reqLogger)
return reconcile.Result{RequeueAfter: requeueAfter}, nil
}

Expand Down Expand Up @@ -243,9 +243,9 @@ func (r *ReconcileDistributedRedisCluster) Reconcile(request reconcile.Request)
reqLogger.WithValues("err", err).Info("requeue")
return reconcile.Result{RequeueAfter: requeueAfter}, nil
}
new := instance.Status.DeepCopy()
SetClusterFailed(new, err.Error())
r.updateClusterIfNeed(instance, new, reqLogger)
newStatus := instance.Status.DeepCopy()
SetClusterFailed(newStatus, err.Error())
r.updateClusterIfNeed(instance, newStatus, reqLogger)
return reconcile.Result{}, err
}

Expand Down Expand Up @@ -281,9 +281,9 @@ func (r *ReconcileDistributedRedisCluster) Reconcile(request reconcile.Request)
reqLogger.Info(">>>>>> clustering")
err = r.syncCluster(ctx)
if err != nil {
new := instance.Status.DeepCopy()
SetClusterFailed(new, err.Error())
r.updateClusterIfNeed(instance, new, reqLogger)
newStatus := instance.Status.DeepCopy()
SetClusterFailed(newStatus, err.Error())
r.updateClusterIfNeed(instance, newStatus, reqLogger)
return reconcile.Result{}, err
}
}
Expand Down

0 comments on commit 58901e9

Please sign in to comment.