This commit is contained in:
Kinco 2025-09-18 17:08:14 +05:30 committed by GitHub
commit c753c39c40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 3 deletions

View File

@ -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.