Honor l5d-override-dst for inbound service profiles#267
Conversation
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
| debug!("inbound canonical={:?}", canonical); | ||
|
|
||
| let dst = canonical | ||
| .or_else(|| { |
There was a problem hiding this comment.
This is the one thing in this PR I wasn't completely sure about --- should l5d-override-dst take priority over l5d-canonical-dst, or the other way around?
In practice, I think we won't see both on the same inbound request, since l5d-canonical-dst is expected to only be set by outbound linkerd proxies, while l5d-override-dst is expected to be set only by clients that are not linkerd proxies (as the outbound proxy will strip that header after using it). So, the ordering may not actually matter all that much.
There was a problem hiding this comment.
Good question. i think canonical-dst should take precedence, since it would only have been set by a calling proxy. If l5d-dst-override had also been set, they should in theory be identical (though the override could potentially be non-canonical? maybe?)
There was a problem hiding this comment.
@olix0r yup, that confirms what i was thinking! thanks.
olix0r
left a comment
There was a problem hiding this comment.
thanks for the tests! this looks good to me.
Signed-off-by: Eliza Weisman <[email protected]>
439fbfed Update to rust-1.35.0 (linkerd/linkerd2-proxy#265) db26495e Honor `l5d-override-dst` for inbound service profiles (linkerd/linkerd2-proxy#267) a476e995 metrics: Include the prefix of a Report in log lines (linkerd/linkerd2-proxy#262) 1a52a5e6 discovery: Fall back in MakeService, only on InvalidArgument (linkerd/linkerd2-proxy#268) 35df8ab4 metrics: Classify response errors (linkerd/linkerd2-proxy#269)
439fbfed Update to rust-1.35.0 (linkerd/linkerd2-proxy#265) db26495e Honor `l5d-override-dst` for inbound service profiles (linkerd/linkerd2-proxy#267) a476e995 metrics: Include the prefix of a Report in log lines (linkerd/linkerd2-proxy#262) 1a52a5e6 discovery: Fall back in MakeService, only on InvalidArgument (linkerd/linkerd2-proxy#268) 35df8ab4 metrics: Classify response errors (linkerd/linkerd2-proxy#269)
439fbfed Update to rust-1.35.0 (linkerd/linkerd2-proxy#265) db26495e Honor `l5d-override-dst` for inbound service profiles (linkerd/linkerd2-proxy#267) a476e995 metrics: Include the prefix of a Report in log lines (linkerd/linkerd2-proxy#262) 1a52a5e6 discovery: Fall back in MakeService, only on InvalidArgument (linkerd/linkerd2-proxy#268) 35df8ab4 metrics: Classify response errors (linkerd/linkerd2-proxy#269)
When the proxy receives an inbound request, it strips the
l5d-dst-overrideheader and ignores its value. Instead, this headervalue should be honored in the inbound router as it is in the outbound
router. This will enable service profile discovery from ingresses, for
instance.
This branch changes the inbound router to use the
l5d-override-dstheader preferentially, with only the
l5d-canonical-dstheader takingpriority over it if it is present. The layer that strips the override
header is moved to under the inbound dst router.
In addition, I've added new tests in the discovery module that assert
that the value of the
l5d-override-dstheader is used for profilediscovery when present, on both the inbound and outbound sides of the
proxy. The inbound tests fail prior to the other changes on this branch.
Closes linkerd/linkerd2#2910.
Signed-off-by: Eliza Weisman [email protected]