Skip to content

test: refactoring how we add custom routes#6382

Merged
alyssawilk merged 2 commits intoenvoyproxy:masterfrom
alyssawilk:TODO
Mar 27, 2019
Merged

test: refactoring how we add custom routes#6382
alyssawilk merged 2 commits intoenvoyproxy:masterfrom
alyssawilk:TODO

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

Fixing up a TODO - fitting all route config options simply doesn't scale, so refactoring things so we don't have functions with infinite arguments.

Risk Level: n/a (test only)
Testing: integration test pass
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Copy link
Copy Markdown
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

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

Great, this looks like a way better way of managing all the different options

bool include_attempt_count_header = false, const absl::string_view upgrade = "",
const envoy::api::v2::route::RouteAction::InternalRedirectAction internal_action =
envoy::api::v2::route::RouteAction::PASS_THROUGH_INTERNAL_REDIRECT);
envoy::api::v2::route::VirtualHost createHost(const char* host, const char* route = "/",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: maybe call this createVHost or createVirtualHost?

envoy::api::v2::route::VirtualHost createHost(const char* host, const char* route = "/",
const char* cluster = "cluster_0");

void addVirtualHost(envoy::api::v2::route::VirtualHost& vhost);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

any reason we're not passing this by const ref?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, I'd waffled about using Swap instead of CopyFrom and then forgot so got worst of both :-P
Good catch!

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Copy link
Copy Markdown
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

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

Great, this looks like a way better way of managing all the different options

@alyssawilk alyssawilk merged commit 414f56f into envoyproxy:master Mar 27, 2019
@alyssawilk alyssawilk deleted the TODO branch July 31, 2019 20:32
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