Skip to content

Commit a602326

Browse files
committed
Add clarifying comment regarding podDestination and scaleDownCandidates variables
1 parent f21b047 commit a602326

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cluster-autoscaler/core/static_autoscaler.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,12 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) errors.AutoscalerError
440440
var scaleDownCandidates []*apiv1.Node
441441
var podDestinations []*apiv1.Node
442442

443+
// podDestinations and scaleDownCandidates are initialized based on allNodes variable, which contains only
444+
// registered nodes in cluster.
445+
// It does not include any upcoming nodes which can be part of clusterSnapshot. As an alternative to using
446+
// allNodes here, we could use nodes from clusterSnapshot and explicitly filter out upcoming nodes here but it
447+
// is of little (if any) benefit.
448+
443449
if a.processors == nil || a.processors.ScaleDownNodeProcessor == nil {
444450
scaleDownCandidates = allNodes
445451
podDestinations = allNodes

0 commit comments

Comments
 (0)