Skip to content

Commit

Permalink
Add error checks for SetReplicas call
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekgogia committed Nov 18, 2020
1 parent ac6d21d commit cc6a9bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions pkg/cloudprovider/fake/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ limitations under the License.

package fake

import "fmt"

// fakeError implements controllers.RetryableError & controllers.CodedError
type fakeError struct {
error
Expand All @@ -26,7 +24,6 @@ func (e *fakeError) IsRetryable() bool {
return e.retryAble
}
func (e *fakeError) ErrorCode() string {
fmt.Println("Returning error code ", e.Error())
return e.Error()
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/controllers/scalablenodegroup/v1alpha1/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ var _ = Describe("Examples", func() {
})

It("Test reconciler to scale down nodes", func() {
ng.SetReplicas(10) // set existing replicas higher than desired
Expect(ng.SetReplicas(10)).To(Succeed()) // set existing replicas higher than desired
Expect(fakeController.Reconcile(sng)).To(Succeed())
Expect(ng.GetReplicas()).To(Equal(*desiredReplicas))
})

It("Test reconciler to make no change to node count", func() {
ng.SetReplicas(*desiredReplicas) // set existing replicas equal to desired
Expect(ng.SetReplicas(*desiredReplicas)).To(Succeed()) // set existing replicas equal to desired
Expect(fakeController.Reconcile(sng)).To(Succeed())
Expect(ng.GetReplicas()).To(Equal(*desiredReplicas))
})
Expand Down

0 comments on commit cc6a9bd

Please sign in to comment.