feat: add support for URLRewrite filter and refactor GWAPI translator#819
Merged
Xunzhuo merged 1 commit intoenvoyproxy:mainfrom Dec 22, 2022
Merged
feat: add support for URLRewrite filter and refactor GWAPI translator#819Xunzhuo merged 1 commit intoenvoyproxy:mainfrom
Xunzhuo merged 1 commit intoenvoyproxy:mainfrom
Conversation
869682c to
ffb1cc1
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #819 +/- ##
==========================================
- Coverage 64.33% 64.32% -0.02%
==========================================
Files 46 51 +5
Lines 6189 6391 +202
==========================================
+ Hits 3982 4111 +129
- Misses 1973 2039 +66
- Partials 234 241 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a448a03 to
6f88a33
Compare
Member
|
hello, I am testing this feature, but an error occurred 2022-12-19T07:36:02.079Z INFO cache/logrwrapper.go:29 Got a new request, response_nonce 6, nodeID envoy-default-eg-63636f73-848c6454dd-xnb8v, node_version v1.24.1 {"runner": "xds-server"}
2022-12-19T07:36:02.079Z INFO cache/logrwrapper.go:29 handling v3 xDS resource request, response_nonce 6, nodeID envoy-default-eg-63636f73-848c6454dd-xnb8v, node_version v1.24.1, resource_names_subscribe [], resource_names_unsubscribe [], type_url type.googleapis.com/envoy.config.route.v3.RouteConfiguration, errorCode 13, errorMessage Proto constraint validation failed (RouteConfigurationValidationError.VirtualHosts[0]: embedded message failed validation | caused by VirtualHostValidationError.Routes[0]: embedded message failed validation | caused by RouteValidationError.Route: embedded message failed validation | caused by field: "cluster_specifier", reason: is required):I fixed like this, it works func buildXdsURLRewriteAction(rou *route.Route, routeName string, urlRewrite *ir.URLRewrite) *route.RouteAction {
ret := &route.RouteAction{
ClusterSpecifier: &route.RouteAction_Cluster{
Cluster: routeName,
}} |
Member
|
rewrite the hostname may be set // Types that are assignable to HostRewriteSpecifier:
// *RouteAction_HostRewriteLiteral
// *RouteAction_AutoHostRewrite
// *RouteAction_HostRewriteHeader
// *RouteAction_HostRewritePathRegex
HostRewriteSpecifier isRouteAction_HostRewriteSpecifier `protobuf_oneof:"host_rewrite_specifier"`
// If set, then a host rewrite action (one of
// :ref:`host_rewrite_literal <envoy_v3_api_field_config.route.v3.RouteAction.host_rewrite_literal>`,
// :ref:`auto_host_rewrite <envoy_v3_api_field_config.route.v3.RouteAction.auto_host_rewrite>`,
// :ref:`host_rewrite_header <envoy_v3_api_field_config.route.v3.RouteAction.host_rewrite_header>`, or
// :ref:`host_rewrite_path_regex <envoy_v3_api_field_config.route.v3.RouteAction.host_rewrite_path_regex>`)
// causes the original value of the host header, if any, to be appended to the
// :ref:`config_http_conn_man_headers_x-forwarded-host` HTTP header.
AppendXForwardedHost bool `protobuf:"varint,38,opt,name=append_x_forwarded_host,json=appendXForwardedHost,proto3" json:"append_x_forwarded_host,omitempty"` |
Member
Author
|
Thank you @qicz, though this PR is WIP, but thanks for testing it, I will update this PR ASAP. |
d9810e3 to
c7e0e99
Compare
9149dca to
be6f299
Compare
arkodg
reviewed
Dec 21, 2022
arkodg
reviewed
Dec 21, 2022
arkodg
reviewed
Dec 21, 2022
arkodg
reviewed
Dec 21, 2022
arkodg
reviewed
Dec 21, 2022
arkodg
reviewed
Dec 21, 2022
arkodg
reviewed
Dec 21, 2022
Contributor
|
the PR looks good @Xunzhuo ! thanks for all attached the end user docs as part of this PR. left some comments |
2ab31f8 to
abba7ed
Compare
7935e3b to
65ec238
Compare
Signed-off-by: bitliu <[email protected]>
65ec238 to
c8e0035
Compare
arkodg
approved these changes
Dec 22, 2022
Contributor
arkodg
left a comment
There was a problem hiding this comment.
LGTM, thanks for the refactor too !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #564
Signed-off-by: bitliu [email protected]