@@ -499,7 +499,7 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
499
499
return scaleUpStart
500
500
}
501
501
502
- postScaleUp := func (scaleUpStart time.Time ) ( bool , caerrors. AutoscalerError ) {
502
+ postScaleUp := func (scaleUpStart time.Time ) {
503
503
metrics .UpdateDurationFromStart (metrics .ScaleUp , scaleUpStart )
504
504
505
505
if a .processors != nil && a .processors .ScaleUpStatusProcessor != nil {
@@ -509,15 +509,13 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
509
509
510
510
if typedErr != nil {
511
511
klog .Errorf ("Failed to scale up: %v" , typedErr )
512
- return true , typedErr
512
+ return
513
513
}
514
514
if scaleUpStatus .Result == status .ScaleUpSuccessful {
515
515
a .lastScaleUpTime = currentTime
516
516
// No scale down in this iteration.
517
517
scaleDownStatus .Result = scaledownstatus .ScaleDownInCooldown
518
- return true , nil
519
518
}
520
- return false , nil
521
519
}
522
520
523
521
shouldScaleUp := true
@@ -557,9 +555,7 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
557
555
if shouldScaleUp || a .processors .ScaleUpEnforcer .ShouldForceScaleUp (unschedulablePodsToHelp ) {
558
556
scaleUpStart := preScaleUp ()
559
557
scaleUpStatus , typedErr = a .scaleUpOrchestrator .ScaleUp (unschedulablePodsToHelp , readyNodes , daemonsets , nodeInfosForGroups , false )
560
- if exit , err := postScaleUp (scaleUpStart ); exit {
561
- return err
562
- }
558
+ postScaleUp (scaleUpStart )
563
559
}
564
560
565
561
if a .ScaleDownEnabled {
@@ -664,9 +660,7 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
664
660
if a .EnforceNodeGroupMinSize {
665
661
scaleUpStart := preScaleUp ()
666
662
scaleUpStatus , typedErr = a .scaleUpOrchestrator .ScaleUpToNodeGroupMinSize (readyNodes , nodeInfosForGroups )
667
- if exit , err := postScaleUp (scaleUpStart ); exit {
668
- return err
669
- }
663
+ postScaleUp (scaleUpStart )
670
664
}
671
665
672
666
return nil
0 commit comments