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

feat(translator): implement httproutefilter and path regex rewrite #4258

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

guydc
Copy link
Contributor

@guydc guydc commented Sep 16, 2024

What type of PR is this?

What this PR does / why we need it:

  • Adds an Envoy Gateway Extension filter, HTTPRouteFilter
  • Implements support for regex rewrite of URL paths in HTTPRouteFilter

Which issue(s) this PR fixes:
Fixes #4120, #1794

@guydc guydc requested a review from a team as a code owner September 16, 2024 19:44
@guydc guydc marked this pull request as draft September 17, 2024 23:46
Copy link

codecov bot commented Sep 18, 2024

Codecov Report

Attention: Patch coverage is 74.66667% with 57 lines in your changes missing coverage. Please review.

Project coverage is 65.74%. Comparing base (e5fe849) to head (e65a730).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/provider/kubernetes/routes.go 21.73% 15 Missing and 3 partials ⚠️
internal/gatewayapi/resource/load.go 0.00% 13 Missing ⚠️
internal/provider/kubernetes/controller.go 35.29% 8 Missing and 3 partials ⚠️
internal/provider/kubernetes/predicates.go 62.50% 4 Missing and 2 partials ⚠️
internal/ir/xds.go 71.42% 2 Missing and 2 partials ⚠️
internal/provider/kubernetes/filters.go 60.00% 1 Missing and 1 partial ⚠️
internal/provider/kubernetes/indexers.go 86.66% 1 Missing and 1 partial ⚠️
internal/gatewayapi/resource/resource.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4258      +/-   ##
==========================================
- Coverage   65.75%   65.74%   -0.01%     
==========================================
  Files         197      197              
  Lines       23565    23763     +198     
==========================================
+ Hits        15494    15623     +129     
- Misses       6967     7020      +53     
- Partials     1104     1120      +16     

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

@guydc guydc force-pushed the feat-translator-hrf branch 5 times, most recently from 2a9fe55 to 3c5c126 Compare September 20, 2024 12:55
Signed-off-by: Guy Daich <[email protected]>
@guydc guydc marked this pull request as ready for review September 20, 2024 15:24
@guydc guydc requested a review from a team September 20, 2024 15:26
for _, rule := range httproute.Spec.Rules {
for _, filter := range rule.Filters {
if filter.ExtensionRef != nil && string(filter.ExtensionRef.Kind) == resource.KindHTTPRouteFilter {
// If an explicit Backend namespace is not provided, use the HTTPRoute namespace to
Copy link
Member

@zhaohuabing zhaohuabing Sep 23, 2024

Choose a reason for hiding this comment

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

Nit: remove this comment. Cross-namespace filter reference is not supported.

zhaohuabing
zhaohuabing previously approved these changes Sep 23, 2024
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.

This PR looks great! I just have a nit on the comment, which is non-blocking.

type ExtendedHTTPPathModifier struct {
HTTPPathModifier `json:",inline" yaml:",inline"`
// RegexMatchReplace provides a regex to match an a replacement to perform on the path.
RegexMatchReplace *RegexMatchReplace `json:"regexMatchReplace" yaml:"regexMatchReplace"`
Copy link
Contributor

Choose a reason for hiding this comment

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

omitempty

@arkodg
Copy link
Contributor

arkodg commented Sep 23, 2024

one nit around tag, else LGTM, thanks for adding this !

@arkodg arkodg merged commit 7a9556a into envoyproxy:main Sep 24, 2024
27 checks passed
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.

Consider adding a HTTPRouteFilterExtensionRef for Envoy Gateway
4 participants