Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapping: automatically include the l5d-dst-override header #1643

Merged
merged 23 commits into from
Jul 3, 2019

Conversation

gsagula
Copy link
Contributor

@gsagula gsagula commented Jun 21, 2019

Description

Adds support for automatically include the l5d-dst-override header to all requests, including authorization (when configured).

Related Issues

#1594
#1578

Testing

KAT - mapping and auth tests

Gabriel Linden Sagula added 10 commits June 21, 2019 09:09
Signed-off-by: Gabriel Linden Sagula <[email protected]>
Signed-off-by: Gabriel Linden Sagula <[email protected]>
Signed-off-by: Gabriel Linden Sagula <[email protected]>
Signed-off-by: Gabriel Linden Sagula <[email protected]>
Signed-off-by: Gabriel Linden Sagula <[email protected]>
Signed-off-by: Gabriel Linden Sagula <[email protected]>
Signed-off-by: Gabriel Linden Sagula <[email protected]>
Signed-off-by: Gabriel Linden Sagula <[email protected]>
Signed-off-by: Gabriel Linden Sagula <[email protected]>
Copy link
Member

@kflynn kflynn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small things, and, uh, sorry for adding a merge conflict for you. 🙁 Looks good overall!!

ambassador/ambassador/ir/irambassador.py Outdated Show resolved Hide resolved
ambassador/tests/t_mappingtests.py Show resolved Hide resolved
Gabriel Linden Sagula added 5 commits June 27, 2019 05:51
Signed-off-by: Gabriel Linden Sagula <[email protected]>
Signed-off-by: Gabriel Linden Sagula <[email protected]>
Signed-off-by: Gabriel Linden Sagula <[email protected]>
@gsagula
Copy link
Contributor Author

gsagula commented Jun 27, 2019

@kflynn Thanks for the review. Please feel free to take another look.

Gabriel Linden Sagula added 2 commits June 27, 2019 11:18
Copy link
Member

@kflynn kflynn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like some debugging code got left in a couple of places? But yeah, that ParsedService thing looks good...

ambassador/ambassador/envoy/v2/v2listener.py Outdated Show resolved Hide resolved
ambassador/ambassador/envoy/v2/v2listener.py Outdated Show resolved Hide resolved
ambassador/ambassador/ir/irhttpmapping.py Outdated Show resolved Hide resolved
ambassador/tests/t_extauth.py Show resolved Hide resolved
Flynn and others added 6 commits July 1, 2019 00:37
Copy link
Member

@kflynn kflynn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to go ahead and take this so we can get a test build out to, but there's a small change in logic that I think would be good to get in. Thanks!

else:
add_linkerd_headers = module.get('add_linkerd_headers', None)
if add_linkerd_headers is None:
self["add_linkerd_headers"] = ir.ambassador_module.get('add_linkerd_headers', False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic, I think, is wrong if add_linkerd_headers is explicitly set to False in the AuthService when it's set to True in the ambassador Module. The logic below for IRHTTPMapping looks correct.

else:
if 'add_linkerd_headers' in ir.ambassador_module and ir.ambassador_module.add_linkerd_headers is True:
add_request_hdrs['l5d-dst-override'] = svc.hostname_port

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the logic that should be used in both Mapping and AuthService.

@kflynn kflynn merged commit 085ff3c into master Jul 3, 2019
@kflynn kflynn deleted the linkerd-header branch July 3, 2019 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants