Skip to content

Commit

Permalink
improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
lubedacht committed May 8, 2024
1 parent 3288160 commit 1d08eba
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ func (n *nodePool) IncreaseSize(delta int) error {
if err != nil {
return err
}
targetSize := size + delta
if targetSize > n.max {
return fmt.Errorf("size increase exceeds upper bound of %d", n.max)
desired := size + delta
if desired > n.max {
return fmt.Errorf("size increase exceeds upper bound: current:%d desired:%d max:%d", size, desired, n.max)
}
return n.manager.SetNodeGroupSize(n, targetSize)
return n.manager.SetNodeGroupSize(n, desired)
}

// DeleteNodes deletes nodes from this node group (and also decreasing the size
Expand Down Expand Up @@ -114,8 +114,10 @@ func (n *nodePool) DecreaseTargetSize(delta int) error {
if err != nil {
return err
}
if size+delta < n.min {
return fmt.Errorf("size decrease exceeds lower bound of %d", n.min)

desired := size + delta
if desired < n.min {
return fmt.Errorf("size decrease exceeds lower bound: current:%d desired:%d min:%d", size, desired, n.min)
}
// IonosCloud does not allow modification of the target size while nodes are being provisioned.
return errors.New("currently not supported behavior")
Expand Down

0 comments on commit 1d08eba

Please sign in to comment.