Skip to content

Commit

Permalink
fix: use GetNodeGroupTargetSize instead of GetNodeGroupSize
Browse files Browse the repository at this point in the history
  • Loading branch information
jriedel-ionos authored and k8s-infra-cherrypick-robot committed Nov 15, 2024
1 parent ad081fc commit 999d052
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (n *nodePool) IncreaseSize(delta int) error {
if delta <= 0 {
return errors.New("size increase must be positive")
}
size, err := n.manager.GetNodeGroupSize(n)
size, err := n.manager.GetNodeGroupTargetSize(n)
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,18 @@ func (s *NodeGroupTestSuite) TestIncreaseSize_InvalidDelta() {
}

func (s *NodeGroupTestSuite) TestIncreaseSize_GetSizeError() {
s.manager.On("GetNodeGroupSize", s.nodePool).Return(0, errors.New("error")).Once()
s.manager.On("GetNodeGroupTargetSize", s.nodePool).Return(0, errors.New("error")).Once()
s.Error(s.nodePool.IncreaseSize(2))
}

func (s *NodeGroupTestSuite) TestIncreaseSize_SetSizeError() {
s.manager.On("GetNodeGroupSize", s.nodePool).Return(2, nil).Once()
s.manager.On("GetNodeGroupTargetSize", s.nodePool).Return(2, nil).Once()
s.manager.On("SetNodeGroupSize", s.nodePool, 3).Return(errors.New("error")).Once()
s.Error(s.nodePool.IncreaseSize(1))
}

func (s *NodeGroupTestSuite) TestIncreaseSize_OK() {
s.manager.On("GetNodeGroupSize", s.nodePool).Return(2, nil).Once()
s.manager.On("GetNodeGroupTargetSize", s.nodePool).Return(2, nil).Once()
s.manager.On("SetNodeGroupSize", s.nodePool, 3).Return(nil).Once()
s.NoError(s.nodePool.IncreaseSize(1))
}
Expand Down

0 comments on commit 999d052

Please sign in to comment.