Skip to content

Commit a495219

Browse files
committed
add scale down registration method
this change adds a method to the AutoscalerOptions struct to allow registering a scale down node processor.
1 parent 28bd7b1 commit a495219

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cluster-autoscaler/core/options/autoscaler.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import (
2626
"k8s.io/autoscaler/cluster-autoscaler/expander"
2727
"k8s.io/autoscaler/cluster-autoscaler/observers/loopstart"
2828
ca_processors "k8s.io/autoscaler/cluster-autoscaler/processors"
29+
"k8s.io/autoscaler/cluster-autoscaler/processors/nodes"
30+
"k8s.io/autoscaler/cluster-autoscaler/processors/scaledowncandidates"
2931
"k8s.io/autoscaler/cluster-autoscaler/simulator/clustersnapshot"
3032
"k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules"
3133
draprovider "k8s.io/autoscaler/cluster-autoscaler/simulator/dynamicresources/provider"
@@ -57,3 +59,7 @@ type AutoscalerOptions struct {
5759
DrainabilityRules rules.Rules
5860
DraProvider *draprovider.Provider
5961
}
62+
63+
func (a *AutoscalerOptions) RegisterScaleDownNodeProcessor(np nodes.ScaleDownNodeProcessor) {
64+
a.Processors.ScaleDownNodeProcessor.(*scaledowncandidates.CombinedScaleDownCandidatesProcessor).Register(np)
65+
}

0 commit comments

Comments
 (0)