-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config_types: Add weight validation #3312
config_types: Add weight validation #3312
Conversation
Welcome @jkdihenkar! |
Hi @jkdihenkar. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
@jkdihenkar: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
@johngmyers - tests have passed. can you please review and help this move ahead? |
pkg/ingress/config_types.go
Outdated
@@ -88,6 +88,10 @@ func (t *TargetGroupTuple) validate() error { | |||
if t.ServiceName != nil && t.ServicePort == nil { | |||
return errors.New("missing servicePort") | |||
} | |||
|
|||
if (t.Weight != nil) && (*(t.Weight) < 0 || *(t.Weight) > 999) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Counsider using aws.Int64Value()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review accepted, changes done. thanks for this 🙌
pkg/ingress/config_types.go
Outdated
@@ -88,6 +88,10 @@ func (t *TargetGroupTuple) validate() error { | |||
if t.ServiceName != nil && t.ServicePort == nil { | |||
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error messages should not start with a capital letter. It should probably be worded something like "weight is not between 0 and 999, inclusive"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review accepted, changes done
/retest |
/lgtm |
/retest |
@jkdihenkar it might be necessary to rebase in order to get the e2e test to pass. |
@@ -88,6 +89,10 @@ func (t *TargetGroupTuple) validate() error { | |||
if t.ServiceName != nil && t.ServicePort == nil { | |||
return errors.New("missing servicePort") | |||
} | |||
|
|||
if aws.Int64Value(t.Weight) < 0 || aws.Int64Value(t.Weight) > 999 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, we no longer pull in aws-sdk-go-v2. You need to refer to the Int64Value that is in aws-sdk-go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review accepted!
/lgtm cancel |
/retest |
@johngmyers - can you please take a look now? |
/lgtm |
How do we get this merged into master? |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Thanks for the contribution and sorry for the delay. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jkdihenkar, oliviassss The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@jkdihenkar, can you please rebase the main branch to pick up the fix to e2e tests failure? I cannot merge without test passing. Thanks |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
8f22d99
to
467754d
Compare
New changes are detected. LGTM label has been removed. |
Adding a model validation for weights as described in the AWS LB Documentation - https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#:~:text=You%20can%20use%20forward%20actions%20to%20route%20requests%20to%20one%20or%20more%20target%20groups.%20If%20you%20specify%20multiple%20target%20groups%20for%20a%20forward%20action%2C%20you%20must%20specify%20a%20weight%20for%20each%20target%20group.%20Each%20target%20group%20weight%20is%20a%20value%20from%200%20to%20999.
467754d
to
1a808a2
Compare
@oliviassss - can you take a look now? |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Adding a model validation for weights as described in the AWS LB Documentation -
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#:~:text=You%20can%20use%20forward%20actions%20to%20route%20requests%20to%20one%20or%20more%20target%20groups.%20If%20you%20specify%20multiple%20target%20groups%20for%20a%20forward%20action%2C%20you%20must%20specify%20a%20weight%20for%20each%20target%20group.%20Each%20target%20group%20weight%20is%20a%20value%20from%200%20to%20999.
Issue
Description
Checklist
README.md
, or thedocs
directory)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯