-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
migrate health check filter to v2 api #2047
Merged
Merged
Changes from 69 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
d179e90
Allow non ws requests on WS route
6e84e55
More tests for WebSockets
2cedf44
Fix test for Non WS on WS route
84f2aab
Merge remote-tracking branch 'upstream/master'
37af80d
fix
1645eaf
connect timeout test
928272d
format
6ee6657
fix timeout test
d7a4188
Merge remote-tracking branch 'upstream/master'
8599956
formatting
d2a10c2
Merge remote-tracking branch 'upstream/master'
75ef074
fix auto host rewrite check
baf1ee1
compile fix
dd4b8aa
connectionfailure test
c9a9fa4
update docs
dce2ce1
Merge remote-tracking branch 'upstream/master'
cd70037
Merge remote-tracking branch 'upstream/master'
659e793
configurable cluster name length
b51a666
formatting
9d0366e
Merge remote-tracking branch 'upstream/master'
a724473
Merge remote-tracking branch 'upstream/master'
c5d6e8f
remove CLI option
644b05c
Merge remote-tracking branch 'upstream/master'
d6caed2
fix
3092c06
rds/lds/cds tests
0fd0ba7
Merge remote-tracking branch 'upstream/master'
03c9b31
rename var
7a9e602
format
9ae3160
change CLI option name
98518c0
Merge remote-tracking branch 'upstream/master'
503eecf
feedback
aad79de
sweeping renames
2925163
fix
4507c10
test fix
2527ed1
Merge remote-tracking branch 'upstream/master'
cae08f0
long string to fix hot_restart_test
5afd3ba
remove stray comment
d4de240
docs and nits
65debb2
max len limit for vhosts
fa2d91b
review comments
9ec016c
nits
e9b0dce
Merge remote-tracking branch 'upstream/master'
b534be9
Merge remote-tracking branch 'upstream/master'
d9f3814
Merge remote-tracking branch 'upstream/master'
f9fc5e1
Merge remote-tracking branch 'upstream/master'
4cd58b8
Merge remote-tracking branch 'upstream/master'
e09ea3e
Merge remote-tracking branch 'upstream/master'
9d27e97
Merge remote-tracking branch 'upstream/master'
59bdb58
Merge remote-tracking branch 'upstream/master'
13a8af5
Merge remote-tracking branch 'upstream/master'
3eab89f
Merge remote-tracking branch 'upstream/master'
de6e6f6
Merge branch 'master' of https://github.com/amalgam8/envoy
bc8cff2
Merge remote-tracking branch 'upstream/master'
7063364
buffer filter v2
247518f
format
df39693
includes
ef80354
compile fix
170140a
health check filter - v2
38fb9a6
nits
3e7ce47
Merge branch 'buffer_v2' into healthcheck_v2
4dcc0b9
compile fixes
a1b9ad0
duration cast
0cdf136
Merge branch 'buffer_v2' into healthcheck_v2
9dffdee
new utility macro
d4d248a
Merge branch 'buffer_v2' into healthcheck_v2
0dbda03
lint
5dddde7
compile fixes
e8de97c
really fix compiler errors
efc4453
Merge branch 'master' of https://github.com/lyft/envoy into healthche…
0f1e307
format fix
1ee768f
json_util_set_bool
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,32 +8,30 @@ | |
#include "envoy/http/header_map.h" | ||
#include "envoy/registry/registry.h" | ||
|
||
#include "common/config/filter_json.h" | ||
#include "common/common/assert.h" | ||
#include "common/common/enum_to_int.h" | ||
#include "common/http/codes.h" | ||
#include "common/http/header_map_impl.h" | ||
#include "common/http/headers.h" | ||
#include "common/http/utility.h" | ||
#include "common/json/config_schemas.h" | ||
#include "common/json/json_loader.h" | ||
#include "common/protobuf/utility.h" | ||
|
||
#include "server/config/network/http_connection_manager.h" | ||
|
||
namespace Envoy { | ||
namespace Server { | ||
namespace Configuration { | ||
|
||
/** | ||
* Config registration for the health check filter. @see NamedHttpFilterConfigFactory. | ||
*/ | ||
HttpFilterFactoryCb HealthCheckFilterConfig::createFilterFactory(const Json::Object& config, | ||
const std::string&, | ||
FactoryContext& context) { | ||
config.validateSchema(Json::Schema::HEALTH_CHECK_HTTP_FILTER_SCHEMA); | ||
HttpFilterFactoryCb HealthCheckFilterConfig::createHealthCheckFilter( | ||
const envoy::api::v2::filter::http::HealthCheck& health_check, const std::string&, | ||
FactoryContext& context) { | ||
ASSERT(health_check.has_pass_through_mode()); | ||
ASSERT(!health_check.endpoint().empty()); | ||
|
||
bool pass_through_mode = config.getBoolean("pass_through_mode"); | ||
int64_t cache_time_ms = config.getInteger("cache_time_ms", 0); | ||
std::string hc_endpoint = config.getString("endpoint"); | ||
bool pass_through_mode = health_check.pass_through_mode().value(); | ||
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. sorry as long as you are in here can you make these all const? 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. That's fine we can just merge this and can fix in a follow up. |
||
int64_t cache_time_ms = PROTOBUF_GET_MS_OR_DEFAULT(health_check, cache_time, 0); | ||
std::string hc_endpoint = health_check.endpoint(); | ||
|
||
if (!pass_through_mode && cache_time_ms) { | ||
throw EnvoyException("cache_time_ms must not be set when path_through_mode is disabled"); | ||
|
@@ -52,6 +50,24 @@ HttpFilterFactoryCb HealthCheckFilterConfig::createFilterFactory(const Json::Obj | |
}; | ||
} | ||
|
||
/** | ||
* Config registration for the health check filter. @see NamedHttpFilterConfigFactory. | ||
*/ | ||
HttpFilterFactoryCb HealthCheckFilterConfig::createFilterFactory(const Json::Object& json_config, | ||
const std::string& stats_prefix, | ||
FactoryContext& context) { | ||
envoy::api::v2::filter::http::HealthCheck health_check; | ||
Config::FilterJson::translateHealthCheckFilter(json_config, health_check); | ||
return createHealthCheckFilter(health_check, stats_prefix, context); | ||
} | ||
|
||
HttpFilterFactoryCb HealthCheckFilterConfig::createFilterFactoryFromProto( | ||
const Protobuf::Message& config, const std::string& stats_prefix, FactoryContext& context) { | ||
return createHealthCheckFilter( | ||
dynamic_cast<const envoy::api::v2::filter::http::HealthCheck&>(config), stats_prefix, | ||
context); | ||
} | ||
|
||
/** | ||
* Static registration for the health check filter. @see RegisterFactory. | ||
*/ | ||
|
This file contains 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
This file contains 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
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.
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.
JSON_UTIL_SET_BOOL