Skip to content

Commit

Permalink
Fix auto scaler status syncing error (#2289)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yisaer authored Apr 26, 2020
1 parent f615e9d commit 510bb9f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/autoscaler/autoscaler/autoscaler_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ func (am *autoScalerManager) updateAutoScaling(oldTc *v1alpha1.TidbCluster,
}

if tac.Spec.TiKV != nil {
tac.Status.TiKV.CurrentReplicas = oldTc.Status.TiKV.StatefulSet.CurrentReplicas
if oldTc.Status.TiKV.StatefulSet != nil {
tac.Status.TiKV.CurrentReplicas = oldTc.Status.TiKV.StatefulSet.CurrentReplicas
}
lastTimestamp, err := f(label.AnnTiKVLastAutoScalingTimestamp)
if err != nil {
return err
Expand All @@ -160,7 +162,9 @@ func (am *autoScalerManager) updateAutoScaling(oldTc *v1alpha1.TidbCluster,
tac.Status.TiKV = nil
}
if tac.Spec.TiDB != nil {
tac.Status.TiDB.CurrentReplicas = oldTc.Status.TiDB.StatefulSet.CurrentReplicas
if oldTc.Status.TiDB.StatefulSet != nil {
tac.Status.TiDB.CurrentReplicas = oldTc.Status.TiDB.StatefulSet.CurrentReplicas
}
lastTimestamp, err := f(label.AnnTiDBLastAutoScalingTimestamp)
if err != nil {
return err
Expand Down

0 comments on commit 510bb9f

Please sign in to comment.