headerHashRoute creates a RouteConfiguration with a hash policy that uses the provided header.
(routeName, virtualHostName, clusterName, header string)
| 714 | // headerHashRoute creates a RouteConfiguration with a hash policy that uses the |
| 715 | // provided header. |
| 716 | func headerHashRoute(routeName, virtualHostName, clusterName, header string) *v3routepb.RouteConfiguration { |
| 717 | route := e2e.DefaultRouteConfig(routeName, virtualHostName, clusterName) |
| 718 | hashPolicy := v3routepb.RouteAction_HashPolicy{ |
| 719 | PolicySpecifier: &v3routepb.RouteAction_HashPolicy_Header_{ |
| 720 | Header: &v3routepb.RouteAction_HashPolicy_Header{ |
| 721 | HeaderName: header, |
| 722 | }, |
| 723 | }, |
| 724 | } |
| 725 | action := route.VirtualHosts[0].Routes[0].Action.(*v3routepb.Route_Route) |
| 726 | action.Route.HashPolicy = []*v3routepb.RouteAction_HashPolicy{&hashPolicy} |
| 727 | return route |
| 728 | } |
| 729 | |
| 730 | // Tests that ring hash policy that hashes using a header value can send RPCs |
| 731 | // to specific backends based on their hash. |
no test coverage detected