Skip to content

Commit

Permalink
Fixed the issue where node was not deleted when evicting pods timed out.
Browse files Browse the repository at this point in the history
  • Loading branch information
alphajc committed Sep 27, 2023
1 parent cf8c507 commit 1e5918a
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,18 @@ func (ds *GroupDeletionScheduler) ScheduleDeletion(nodeInfo *framework.NodeInfo,

nodeDeleteResult := ds.prepareNodeForDeletion(nodeInfo, drain)
if nodeDeleteResult.Err != nil {
ds.AbortNodeDeletion(nodeInfo.Node(), nodeGroup.Id(), drain, "prepareNodeForDeletion failed", nodeDeleteResult)
return
isTimeout := true
for _, podEvictionResult := range nodeDeleteResult.PodEvictionResults {
// If there is any error message, it means it is not a pure timeout and node deletion is aborted.
if podEvictionResult.Err != nil {
isTimeout = false
break
}
}
if !isTimeout {
ds.AbortNodeDeletion(nodeInfo.Node(), nodeGroup.Id(), drain, "prepareNodeForDeletion failed", nodeDeleteResult)
return
}
}

ds.addToBatcher(nodeInfo, nodeGroup, batchSize, drain, opts.ZeroOrMaxNodeScaling)
Expand Down

0 comments on commit 1e5918a

Please sign in to comment.