Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions cluster-autoscaler/core/scaleup/orchestrator/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,22 @@ func (e *scaleUpExecutor) executeScaleUp(
e.autoscalingContext.LogRecorder.Eventf(apiv1.EventTypeNormal, "ScaledUpGroup",
"Scale-up: setting group %s size to %d instead of %d (max: %d)", info.Group.Id(), info.NewSize, info.CurrentSize, info.MaxSize)
increase := info.NewSize - info.CurrentSize
if increase < 0 {
err := errors.NewAutoscalerError(
errors.InternalError,
fmt.Sprintf("increase in number of nodes cannot be negative (current: %d, new: %d, delta: %d)", info.CurrentSize, info.NewSize, increase),
)
e.autoscalingContext.LogRecorder.Eventf(apiv1.EventTypeWarning, "FailedToScaleUpGroup", "Scale-up aborted for group %s: %v", info.Group.Id(), err)
e.scaleStateNotifier.RegisterFailedScaleUp(info.Group, string(err.Type()), err.Error(), gpuResourceName, gpuType, now)

return err
}
if err := e.increaseSize(info.Group, increase, atomic); err != nil {
e.autoscalingContext.LogRecorder.Eventf(apiv1.EventTypeWarning, "FailedToScaleUpGroup", "Scale-up failed for group %s: %v", info.Group.Id(), err)
aerr := errors.ToAutoscalerError(errors.CloudProviderError, err).AddPrefix("failed to increase node group size: ")
e.scaleStateNotifier.RegisterFailedScaleUp(info.Group, string(aerr.Type()), aerr.Error(), gpuResourceName, gpuType, now)
return aerr
}
if increase < 0 {
return errors.NewAutoscalerError(errors.InternalError, fmt.Sprintf("increase in number of nodes cannot be negative, got: %v", increase))
}
if !info.Group.Exist() && e.asyncNodeGroupStateChecker.IsUpcoming(info.Group) {
// Don't emit scale up event for upcoming node group as it will be generated after
// the node group is created, during initial scale up.
Expand Down
Loading