Add clear_route_cache option in McpJsonRestBridge filter#45906
Conversation
Signed-off-by: Michael Behr <mkbehr@google.com>
|
/assign tyxia |
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
tyxia
left a comment
There was a problem hiding this comment.
Mostly LGTM module the API comment.
Thanks!
| // When set to true, the filter will clear the route cache after transcoding. | ||
| // This allows the route to be re-selected based on the updated request path or method. | ||
| // Defaults to false. | ||
| bool clear_route_cache = 7; |
There was a problem hiding this comment.
IMO, we should keep the default behavior same as before, since if path/host has been transcoded it makes sense to clear route cache to enable route re-selection as default behavior. To do so, we can either (1) have BoolValue (a special wrapper message) and set it True by default. or (2) tweak the logic a bit: change to disable_clear_route_cache and it is default to false.
I probably prefer option 2 as it is simpler and easy
Commit Message: mcp_transcoder: Add clear_route_cache option in McpJsonRestBridge filter
Additional Description:
Add a
clear_route_cachefield toMcpJsonRestBridge's config. If set, the filter will clear the route cache when serving MCP traffic. The field defaults to false, to match the corresponding config forMcpFilter. This is a behavioral change; the old behavior was to always clear the route cache (as though the field were true).Risk Level: Low
Testing: Unit and integration tests
Docs Changes: N/A
Release Notes: yes
Platform Specific Features: N/A
API Considerations: The default behavior is a behavioral change, in order to bring the default in line with
McpFilter. We don't think this filter is widely used yet. The old behavior can be restored with xDS-gated config.