Skip to content

Commit

Permalink
Update using of force option in node draining
Browse files Browse the repository at this point in the history
  • Loading branch information
Uladzislau97 committed Feb 13, 2025
1 parent c3c1f15 commit dda5594
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cluster-autoscaler/core/scaledown/actuation/drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ func (e Evictor) drainNode(ctx *acontext.AutoscalingContext, nodeInfo *framework
if e.fullDsEviction {
return e.drainNodeWithPodsBasedOnPodPriority(ctx, node, append(pods, dsPods...), nil, force)
}
return e.drainNodeWithPodsBasedOnPodPriority(ctx, node, pods, dsPods, false)
return e.drainNodeWithPodsBasedOnPodPriority(ctx, node, pods, dsPods, force)
}

// EvictDaemonSetPods creates eviction objects for all DaemonSet pods on the node.
// Eviction of DaemonSet pods are best effort. Does not wait for evictions to finish.
func (e Evictor) EvictDaemonSetPods(ctx *acontext.AutoscalingContext, nodeInfo *framework.NodeInfo) (map[string]status.PodEvictionResult, error) {
node := nodeInfo.Node()
dsPods, _ := podsToEvict(nodeInfo, ctx.DaemonSetEvictionForEmptyNodes)
return e.drainNodeWithPodsBasedOnPodPriority(ctx, node, nil, dsPods, false)
return e.drainNodeWithPodsBasedOnPodPriority(ctx, node, nil, dsPods, false) // force option applies only to full eviction pods
}

// drainNodeWithPodsBasedOnPodPriority performs drain logic on the node based on pod priorities.
Expand Down Expand Up @@ -193,7 +193,7 @@ func (e Evictor) initiateEviction(ctx *acontext.AutoscalingContext, node *apiv1.

for _, pod := range bestEffortEvictionPods {
go func(pod *apiv1.Pod) {
bestEffortEvictionConfirmations <- e.evictPod(ctx, pod, retryUntil, maxTermination, false, false)
bestEffortEvictionConfirmations <- e.evictPod(ctx, pod, retryUntil, maxTermination, false, false) // force option applies only to full eviction pods
}(pod)
}

Expand Down

0 comments on commit dda5594

Please sign in to comment.