From e3ce8a9a15205e5a57f40c8449450a0fef512221 Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Fri, 15 Nov 2019 04:42:52 +0000 Subject: [PATCH] thrift-proxy: add support for cluster header based routing (#8994) Fixes: #8991 Signed-off-by: Raul Gutierrez Segales Mirrored from https://github.com/envoyproxy/envoy @ d5f3efdaac875c9ee87424bc4f07af9c04c2b2ec --- .../filter/network/thrift_proxy/v2alpha1/route.proto | 9 ++++++++- .../filter/network/thrift_proxy/v3alpha/route.proto | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/envoy/config/filter/network/thrift_proxy/v2alpha1/route.proto b/envoy/config/filter/network/thrift_proxy/v2alpha1/route.proto index 170ed4e6..8f85fab5 100644 --- a/envoy/config/filter/network/thrift_proxy/v2alpha1/route.proto +++ b/envoy/config/filter/network/thrift_proxy/v2alpha1/route.proto @@ -69,7 +69,7 @@ message RouteMatch { repeated api.v2.route.HeaderMatcher headers = 4; } -// [#next-free-field: 6] +// [#next-free-field: 7] message RouteAction { oneof cluster_specifier { option (validate.required) = true; @@ -82,6 +82,13 @@ message RouteAction { // request is routed to one of the upstream clusters based on weights // assigned to each cluster. WeightedCluster weighted_clusters = 2; + + // Envoy will determine the cluster to route to by reading the value of the + // Thrift header named by cluster_header from the request headers. If the + // header is not found or the referenced cluster does not exist Envoy will + // respond with an unknown method exception or an internal error exception, + // respectively. + string cluster_header = 6 [(validate.rules).string = {min_bytes: 1}]; } // Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints in diff --git a/envoy/config/filter/network/thrift_proxy/v3alpha/route.proto b/envoy/config/filter/network/thrift_proxy/v3alpha/route.proto index f666320b..f7dc5219 100644 --- a/envoy/config/filter/network/thrift_proxy/v3alpha/route.proto +++ b/envoy/config/filter/network/thrift_proxy/v3alpha/route.proto @@ -69,7 +69,7 @@ message RouteMatch { repeated api.v3alpha.route.HeaderMatcher headers = 4; } -// [#next-free-field: 6] +// [#next-free-field: 7] message RouteAction { oneof cluster_specifier { option (validate.required) = true; @@ -82,6 +82,13 @@ message RouteAction { // request is routed to one of the upstream clusters based on weights // assigned to each cluster. WeightedCluster weighted_clusters = 2; + + // Envoy will determine the cluster to route to by reading the value of the + // Thrift header named by cluster_header from the request headers. If the + // header is not found or the referenced cluster does not exist Envoy will + // respond with an unknown method exception or an internal error exception, + // respectively. + string cluster_header = 6 [(validate.rules).string = {min_bytes: 1}]; } // Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints in