@@ -606,7 +606,7 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
606
606
607
607
metrics .UpdateDurationFromStart (metrics .FindUnneeded , unneededStart )
608
608
609
- scaleDownInCooldown := a .isScaleDownInCooldown (currentTime , scaleDownCandidates )
609
+ scaleDownInCooldown := a .isScaleDownInCooldown (currentTime )
610
610
klog .V (4 ).Infof ("Scale down status: lastScaleUpTime=%s lastScaleDownDeleteTime=%v " +
611
611
"lastScaleDownFailTime=%s scaleDownForbidden=%v scaleDownInCooldown=%v" ,
612
612
a .lastScaleUpTime , a .lastScaleDownDeleteTime , a .lastScaleDownFailTime ,
@@ -628,6 +628,11 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
628
628
if scaleDownInCooldown {
629
629
scaleDownStatus .Result = scaledownstatus .ScaleDownInCooldown
630
630
a .updateSoftDeletionTaints (allNodes )
631
+ } else if len (scaleDownCandidates ) == 0 {
632
+ klog .V (4 ).Infof ("Starting scale down: no scale down candidates. skipping..." )
633
+ scaleDownStatus .Result = scaledownstatus .ScaleDownNoCandidates
634
+ metrics .UpdateLastTime (metrics .ScaleDown , time .Now ())
635
+ a .updateSoftDeletionTaints (allNodes )
631
636
} else {
632
637
klog .V (4 ).Infof ("Starting scale down" )
633
638
@@ -712,8 +717,8 @@ func (a *StaticAutoscaler) addUpcomingNodesToClusterSnapshot(upcomingCounts map[
712
717
return nil
713
718
}
714
719
715
- func (a * StaticAutoscaler ) isScaleDownInCooldown (currentTime time.Time , scaleDownCandidates [] * apiv1. Node ) bool {
716
- scaleDownInCooldown := a .processorCallbacks .disableScaleDownForLoop || len ( scaleDownCandidates ) == 0
720
+ func (a * StaticAutoscaler ) isScaleDownInCooldown (currentTime time.Time ) bool {
721
+ scaleDownInCooldown := a .processorCallbacks .disableScaleDownForLoop
717
722
718
723
if a .ScaleDownDelayTypeLocal {
719
724
return scaleDownInCooldown
0 commit comments