Skip to content

bug: skip backendRefs with weight set to 0 - #2515

Merged
arkodg merged 2 commits into
envoyproxy:mainfrom
arkodg:weight-0
Jan 27, 2024
Merged

arkodg merged 2 commits into
envoyproxy:mainfrom
arkodg:weight-0

Conversation

@arkodg

@arkodg arkodg commented Jan 27, 2024

Copy link
Copy Markdown
Contributor
If weight is set to 0, no traffic should be forwarded for this entry.

Fixes #2495

* Envoy's `LocalityLbEndpoints.LoadBalancingWeight` only accepts weights
  greater than 0. So skip such backends/endpoints in the gateway api
  layer
* From the API spec, no other processing is required for such cases
https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1.BackendRef
```
If weight is set to 0, no traffic should be forwarded for this entry.
```

Fixes envoyproxy#2495

Signed-off-by: Arko Dasgupta <[email protected]>
@arkodg
arkodg requested a review from a team as a code owner January 27, 2024 00:52
@arkodg arkodg changed the title Skip backendRefs with weight set to 0 bug: skip backendRefs with weight set to 0 Jan 27, 2024
}

// Add common test fixtures
for i := 1; i <= 3; i++ {

@zirain zirain Jan 27, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use retry package?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this func create service resources on the fly so we dont need to manually add them in the YAML

@codecov

codecov Bot commented Jan 27, 2024

Copy link
Copy Markdown

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (2feae69) 64.70% compared to head (d62b4a9) 64.69%.
Report is 2 commits behind head on main.

Files Patch % Lines
internal/provider/kubernetes/controller.go 36.36% 6 Missing and 1 partial ⚠️
internal/gatewayapi/runner/runner.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2515      +/-   ##
==========================================
- Coverage   64.70%   64.69%   -0.02%     
==========================================
  Files         116      116              
  Lines       17576    17590      +14     
==========================================
+ Hits        11373    11380       +7     
- Misses       5476     5481       +5     
- Partials      727      729       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arkodg
arkodg requested review from a team January 27, 2024 01:25
@arkodg
arkodg merged commit 796a093 into envoyproxy:main Jan 27, 2024
@arkodg
arkodg deleted the weight-0 branch January 27, 2024 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weighted Backend couldn't set to 0

3 participants