Skip to content

Commit

Permalink
revert deleteCreatedNodesWithErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
daimaxiaxie committed Jun 21, 2024
1 parent e60ad7d commit 76dd0af
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions cluster-autoscaler/core/static_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -883,22 +883,6 @@ func (a *StaticAutoscaler) deleteCreatedNodesWithErrors() (bool, error) {
if nodeGroup == nil {
err = fmt.Errorf("node group %s not found", nodeGroupId)
} else {
targetSize := 0
targetSize, err = nodeGroup.TargetSize()
if err != nil {
klog.Warningf("Failed to get node group size; nodeGroup=%v; err=%v", nodeGroup.Id(), err)
continue
}
possibleToDelete := targetSize - nodeGroup.MinSize()
if possibleToDelete <= 0 {
klog.Warningf("Node group %s min size reached, skipping removal of %v create error nodes", nodeGroupId, len(nodesToBeDeleted))
continue
}
if len(nodesToBeDeleted) > possibleToDelete {
klog.Warningf("Capping node group %s create error node removal to %d nodes, removing all %d would exceed min size constaint", nodeGroupId, possibleToDelete, len(nodesToBeDeleted))
nodesToBeDeleted = nodesToBeDeleted[:possibleToDelete]
}

var opts *config.NodeGroupAutoscalingOptions
opts, err = nodeGroup.GetOptions(a.NodeGroupDefaults)
if err != nil && err != cloudprovider.ErrNotImplemented {
Expand Down

0 comments on commit 76dd0af

Please sign in to comment.