feat: add support for URLRewrite filter and refactor GWAPI translator#819
feat: add support for URLRewrite filter and refactor GWAPI translator#819Xunzhuo merged 1 commit intoenvoyproxy:mainfrom
Conversation
869682c to
ffb1cc1
Compare
Codecov Report
@@ Coverage Diff @@
## main #819 +/- ##
==========================================
+ Coverage 64.33% 64.35% +0.01%
==========================================
Files 46 51 +5
Lines 6189 6391 +202
==========================================
+ Hits 3982 4113 +131
- Misses 1973 2036 +63
- Partials 234 242 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
a448a03 to
6f88a33
Compare
|
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,
}} |
|
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"` |
|
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
|
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 <bitliu@tencent.com>
65ec238 to
c8e0035
Compare
arkodg
left a comment
There was a problem hiding this comment.
LGTM, thanks for the refactor too !
Resolves: #564
Signed-off-by: bitliu bitliu@tencent.com