Skip to content

Commit

Permalink
[clusterapi] Do not skip nodegroups with minSize=maxSize
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxFedotov committed Mar 13, 2024
1 parent 601da3f commit 30ebf5c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package clusterapi

import (
"fmt"
"k8s.io/klog/v2"
"math/rand"

"github.com/pkg/errors"
Expand Down Expand Up @@ -355,7 +356,12 @@ func newNodeGroupFromScalableResource(controller *machineController, unstructure
}

// Ensure the node group would have the capacity to scale
if scalableResource.MaxSize()-scalableResource.MinSize() < 1 {
// allow MinSize = 0
// allow MaxSize = MinSize
// don't allow MaxSize < MinSize
// don't allow MaxSize = MinSize = 0
if scalableResource.MaxSize()-scalableResource.MinSize() < 0 || scalableResource.MaxSize() == 0 {
klog.V(4).Infof("nodegroup %s has no scaling capacity, skipping", scalableResource.Name())
return nil, nil
}

Expand Down

0 comments on commit 30ebf5c

Please sign in to comment.