Skip to content
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

fix: Gateway-target BTP ignored when route timeout defined #4860

Merged
merged 5 commits into from
Dec 11, 2024

Conversation

guydc
Copy link
Contributor

@guydc guydc commented Dec 6, 2024

What type of PR is this?

What this PR does / why we need it:

Returns the Gateway-API HTTPRoute timeout to the Route IR struct, extracting it from the TrafficFeatures struct. Both HTTPRoute and BTP may define a route timeout. Instead of merging during IR calculation, both values are now saved in IR. The effective route timeout is calculated in XDS translation, giving precedence to GW-API settings.
This simplifies merging logic and makes it easy to identify routes that a gateway-level policy should be applied to.

Which issue(s) this PR fixes:

Fixes #4844

Release Notes: Yes/No

Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 92.59259% with 2 lines in your changes missing coverage. Please review.

Project coverage is 66.29%. Comparing base (9ef758b) to head (af2360a).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/clustersettings.go 50.00% 0 Missing and 1 partial ⚠️
internal/gatewayapi/route.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4860   +/-   ##
=======================================
  Coverage   66.28%   66.29%           
=======================================
  Files         209      209           
  Lines       31956    31923   -33     
=======================================
- Hits        21182    21163   -19     
+ Misses       9525     9515   -10     
+ Partials     1249     1245    -4     

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

@guydc guydc marked this pull request as ready for review December 9, 2024 12:54
@guydc guydc requested a review from a team as a code owner December 9, 2024 12:54
@arkodg
Copy link
Contributor

arkodg commented Dec 9, 2024

looks good thanks, does the unit test cover the regression (overriden policy attached to Gateway + timeout specified in HTTPRoute)?

@guydc
Copy link
Contributor Author

guydc commented Dec 9, 2024

looks good thanks, does the unit test cover the regression (overriden policy attached to Gateway + timeout specified in HTTPRoute)?

Yea. Internal/gatewayapi/testdata/backendtrafficpolicy-with-httproute-timeout.in.yaml now has a GW-attached BTP with some LB settings. route-2 has a route timeout and gets the GW-level BTP. The IR contains both BTP settings for LB and timeout.

Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks !

Copy link
Member

@zhaohuabing zhaohuabing left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@zirain zirain merged commit e6fce34 into envoyproxy:main Dec 11, 2024
24 checks passed
guydc added a commit to guydc/gateway that referenced this pull request Dec 12, 2024
…y#4860)

* fix: Gateway-target BTP ignored when route timeout defined

Signed-off-by: Guy Daich <[email protected]>

* fix gen, add note

Signed-off-by: Guy Daich <[email protected]>

---------

Signed-off-by: Guy Daich <[email protected]>
(cherry picked from commit e6fce34)
Signed-off-by: Guy Daich <[email protected]>
guydc added a commit that referenced this pull request Dec 12, 2024
* fix: EnvoyExtensionPolicy reference grant (#4851)

* fix: EnvoyExtensionPolicy reference grant

Signed-off-by: Guy Daich <[email protected]>

* fix lint, add release note

Signed-off-by: Guy Daich <[email protected]>

---------

Signed-off-by: Guy Daich <[email protected]>
(cherry picked from commit 905405e)
Signed-off-by: Guy Daich <[email protected]>

* fix: Gateway-target BTP ignored when route timeout defined (#4860)

* fix: Gateway-target BTP ignored when route timeout defined

Signed-off-by: Guy Daich <[email protected]>

* fix gen, add note

Signed-off-by: Guy Daich <[email protected]>

---------

Signed-off-by: Guy Daich <[email protected]>
(cherry picked from commit e6fce34)
Signed-off-by: Guy Daich <[email protected]>

* build(deps): bump golang.org/x/crypto from 0.30.0 to 0.31.0 (#4901)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.30.0 to 0.31.0.
- [Commits](golang/crypto@v0.30.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit d71ba7b)
Signed-off-by: Guy Daich <[email protected]>

---------

Signed-off-by: Guy Daich <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
zhaohuabing pushed a commit to zhaohuabing/gateway that referenced this pull request Dec 13, 2024
…y#4860)

* fix: Gateway-target BTP ignored when route timeout defined

Signed-off-by: Guy Daich <[email protected]>

* fix gen, add note

Signed-off-by: Guy Daich <[email protected]>

---------

Signed-off-by: Guy Daich <[email protected]>
(cherry picked from commit e6fce34)
Signed-off-by: Huabing Zhao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BackendTrafficPolicy attached to Gateway has no affect in case timeouts are configured on HTTPRoute
4 participants