Skip to content

Commit c9ca86c

Browse files
committed
review changes: reword error msg and use aws.Int64Value
1 parent 4b30155 commit c9ca86c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/ingress/config_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package ingress
22

33
import (
4+
"github.com/aws/aws-sdk-go-v2/aws"
45
"github.com/aws/aws-sdk-go/service/elbv2"
56
"github.com/pkg/errors"
67
"k8s.io/apimachinery/pkg/util/intstr"
@@ -89,8 +90,8 @@ func (t *TargetGroupTuple) validate() error {
8990
return errors.New("missing servicePort")
9091
}
9192

92-
if (t.Weight != nil) && (*(t.Weight) < 0 || *(t.Weight) > 999) {
93-
return errors.New("The weight for each target group must be between 0 and 999, inclusive")
93+
if aws.Int64Value(t.Weight) < 0 || aws.Int64Value(t.Weight) > 999 {
94+
return errors.New("weight value not between 0 and 999, inclusive")
9495
}
9596
return nil
9697
}

0 commit comments

Comments
 (0)