Skip to content

Commit

Permalink
review changes: reword error msg and use aws.Int64Value
Browse files Browse the repository at this point in the history
  • Loading branch information
jkdihenkar committed Aug 10, 2023
1 parent f9fafa4 commit e0358eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/ingress/config_types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ingress

import (
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go/service/elbv2"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -89,8 +90,8 @@ func (t *TargetGroupTuple) validate() error {
return errors.New("missing servicePort")
}

if (t.Weight != nil) && (*(t.Weight) < 0 || *(t.Weight) > 999) {
return errors.New("The weight for each target group must be between 0 and 999, inclusive")
if aws.Int64Value(t.Weight) < 0 || aws.Int64Value(t.Weight) > 999 {
return errors.New("weight value not between 0 and 999, inclusive")
}
return nil
}
Expand Down

0 comments on commit e0358eb

Please sign in to comment.