-
Notifications
You must be signed in to change notification settings - Fork 5.5k
test: refactoring how we add custom routes #6382
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,17 +104,10 @@ class ConfigHelper { | |
| // Set the connect timeout on upstream connections. | ||
| void setConnectTimeout(std::chrono::milliseconds timeout); | ||
|
|
||
| // TODO(alyssawilk) this does not scale. Refactor. | ||
| // Add an additional route to the configuration. | ||
| void addRoute(const std::string& host, const std::string& route, const std::string& cluster, | ||
| bool validate_clusters, | ||
| envoy::api::v2::route::RouteAction::ClusterNotFoundResponseCode code, | ||
| envoy::api::v2::route::VirtualHost::TlsRequirementType type = | ||
| envoy::api::v2::route::VirtualHost::NONE, | ||
| envoy::api::v2::route::RetryPolicy retry_policy = {}, | ||
| 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 = "/", | ||
| const char* cluster = "cluster_0"); | ||
|
|
||
| void addVirtualHost(envoy::api::v2::route::VirtualHost& vhost); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any reason we're not passing this by const ref?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| // Add an HTTP filter prior to existing filters. | ||
| void addFilter(const std::string& filter_yaml); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe call this
createVHostorcreateVirtualHost?