Skip to content

Commit

Permalink
fix wrong type inputed in DrainNode
Browse files Browse the repository at this point in the history
has to be of type NodeInfo
  • Loading branch information
nvthongswansea committed Jan 21, 2024
1 parent bee875d commit bf604be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cluster-autoscaler/core/scaledown/actuation/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,12 @@ func (a *Actuator) drainNodesSyncForGridscaleProvider(nodeGroupID string, nodes
var finishFuncList []func(resultType status.NodeDeleteResultType, err error)
for _, node := range nodes {
a.nodeDeletionTracker.StartDeletionWithDrain(nodeGroupID, node.Name)
evictionResults, err := a.evictor.DrainNode(a.ctx, node)
nodeInfo, err := a.ctx.ClusterSnapshot.NodeInfos().Get(node.Name)
if err != nil {
a.ctx.Recorder.Eventf(node, apiv1.EventTypeWarning, "ScaleDownFailed", "failed to get node info of the node: %v", err)
return nil, errors.NewAutoscalerError(errors.ApiCallError, "couldn't get node info of the node %q before draining", node)
}
evictionResults, err := a.evictor.DrainNode(a.ctx, nodeInfo)
klog.V(4).Infof("Scale-down: drain results for node %s: %v", node.Name, evictionResults)
if err != nil {
a.nodeDeletionTracker.EndDeletion(nodeGroupID, node.Name, status.NodeDeleteResult{
Expand Down

0 comments on commit bf604be

Please sign in to comment.