router: add auto_host_rewrite support to RequestMirrorPolicy#44450
Open
derekargueta wants to merge 3 commits intoenvoyproxy:mainfrom
Open
router: add auto_host_rewrite support to RequestMirrorPolicy#44450derekargueta wants to merge 3 commits intoenvoyproxy:mainfrom
derekargueta wants to merge 3 commits intoenvoyproxy:mainfrom
Conversation
Adds a new `auto_host_rewrite` field to `RequestMirrorPolicy` so that mirrored requests can have their Host header rewritten to the upstream hostname selected by the shadow cluster's load balancer. This mirrors the existing `auto_host_rewrite` behavior on the main route. Previously, mirror policies only supported `host_rewrite_literal` for host manipulation. When `auto_host_rewrite` is set, the `-shadow` suffix append is implicitly disabled (same behavior as `host_rewrite_literal`). If the selected upstream host has no hostname (e.g. a STATIC cluster), the header is left unchanged. Fixes envoyproxy#9326 Signed-off-by: Derek Argueta <dereka@airbnb.com> Signed-off-by: Derek Argueta <derek.argueta@airbnb.com>
Signed-off-by: Derek Argueta <derek.argueta@airbnb.com>
Member
Author
|
Both failures in Envoy/Checks appear to be pre-existing flakes unrelated to this PR. The tsan failures are in |
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Signed-off-by: Derek Argueta <derek.argueta@airbnb.com>
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.
Fixes #9326.
The issue has been open since 2020. When a route uses both
request_mirror_policyandauto_host_rewrite, the mirrored request gets the wrong Host header because the shadow is dispatched before the main request's upstream connection is established (and thus beforeauto_host_rewritehas a chance to fire). The discussion in the issue thread converged on addingauto_host_rewritedirectly toRequestMirrorPolicyso it can be applied independently by the shadow writer.Risk Level: low
Testing: unit tests
Docs Changes: done
Release Notes: done
Platform Specific Features: no