From 4e861a451018eb72c3d27b0bb7274e5797ad098f Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Wed, 2 Dec 2020 01:46:34 -0800 Subject: [PATCH 1/5] extension: use bool_flag to control extension link Signed-off-by: Lizan Zhou --- bazel/README.md | 23 ++++++++--- bazel/envoy_build_system.bzl | 13 +++++- bazel/envoy_library.bzl | 17 +++++++- bazel/envoy_test.bzl | 2 + docs/generate_extension_db.py | 4 +- .../http/http_filters/kill_request_filter.rst | 3 +- source/extensions/all_extensions.bzl | 16 ++++---- source/extensions/extensions_build_config.bzl | 9 ++-- .../filters/http/kill_request/BUILD | 2 +- test/extensions/extensions_build_system.bzl | 41 ++++++------------- tools/code_format/envoy_build_fixer.py | 2 +- tools/dependency/validate.py | 5 +-- 12 files changed, 78 insertions(+), 59 deletions(-) diff --git a/bazel/README.md b/bazel/README.md index 50379a6efd0a..e4d4d4a9cf22 100644 --- a/bazel/README.md +++ b/bazel/README.md @@ -658,17 +658,30 @@ The following optional features can be enabled on the Bazel build command-line: * Envoy can be linked to [`zlib-ng`](https://github.com/zlib-ng/zlib-ng) instead of [`zlib`](https://zlib.net) with `--define zlib=ng`. -## Disabling extensions +## Enabling and disabling extensions Envoy uses a modular build which allows extensions to be removed if they are not needed or desired. Extensions that can be removed are contained in -[extensions_build_config.bzl](../source/extensions/extensions_build_config.bzl). Use the following -procedure to customize the extensions for your build: +[extensions_build_config.bzl](../source/extensions/extensions_build_config.bzl). + +The extensions disabled by default can be enabled by adding the following parameter to Bazel, for example to enable +`envoy.filters.http.kill_request` extension, add `--//source/extensions/filters/http/kill_request:enabled`. +The extensions enabled by default can be disabled by adding the following parameter to Bazel, for example to disable +`envoy.wasm.runtime.v8` extension, add `--//source/extensions/wasm_runtime/v8:enabled=false`. +Note not all extensions can be disabled. + +If you're building from a custom build repository, the parameters need to prefixed with `@envoy`, for example +`--@envoy//source/extensions/filters/http/kill_request:enabled`. + +You may persist those options in `user.bazelrc` in Envoy repo or your `.bazelrc`. + +## Customize extension build config + +You can also use the following procedure to customize the extensions for your build: * The Envoy build assumes that a Bazel repository named `@envoy_build_config` exists which contains the file `@envoy_build_config//:extensions_build_config.bzl`. In the default build, a synthetic repository is created containing [extensions_build_config.bzl](../source/extensions/extensions_build_config.bzl). - Thus, the default build has all extensions. * Start by creating a new Bazel workspace somewhere in the filesystem that your build can access. This workspace should contain: * Empty WORKSPACE file. @@ -683,7 +696,7 @@ To have your local build use your overridden configuration repository there are 2. Use the following snippet in your WORKSPACE before you load the Envoy repository. E.g., ``` -workspace(name = "envoy") +workspace(name = "envoy_filter_example") local_repository( name = "envoy_build_config", diff --git a/bazel/envoy_build_system.bzl b/bazel/envoy_build_system.bzl index 283cf130af22..e8dd5dd0bc25 100644 --- a/bazel/envoy_build_system.bzl +++ b/bazel/envoy_build_system.bzl @@ -40,13 +40,24 @@ load( "@envoy_build_config//:extensions_build_config.bzl", "EXTENSION_PACKAGE_VISIBILITY", ) +load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") def envoy_package(): native.package(default_visibility = ["//visibility:public"]) -def envoy_extension_package(): +def envoy_extension_package(enabled_default = True): native.package(default_visibility = EXTENSION_PACKAGE_VISIBILITY) + bool_flag( + name = "enabled", + build_setting_default = enabled_default, + ) + + native.config_setting( + name = "is_enabled", + flag_values = {":enabled": "True"}, + ) + # A genrule variant that can output a directory. This is useful when doing things like # generating a fuzz corpus mechanically. def _envoy_directory_genrule_impl(ctx): diff --git a/bazel/envoy_library.bzl b/bazel/envoy_library.bzl index a2f7c6b0ae02..ca64d5a09e00 100644 --- a/bazel/envoy_library.bzl +++ b/bazel/envoy_library.bzl @@ -93,7 +93,22 @@ def envoy_cc_extension( fail("Unknown extension status: " + status) if "//visibility:public" not in visibility: visibility = visibility + extra_visibility - envoy_cc_library(name, tags = tags, visibility = visibility, **kwargs) + + ext_name = name + "_envoy_extension" + envoy_cc_library( + name = name, + tags = tags, + visibility = visibility, + **kwargs + ) + cc_library( + name = ext_name, + deps = select({ + ":is_enabled": [":" + name], + "//conditions:default": [], + }), + visibility = visibility, + ) # Envoy C++ library targets should be specified with this function. def envoy_cc_library( diff --git a/bazel/envoy_test.bzl b/bazel/envoy_test.bzl index 1d5720149428..089a0e5c8c72 100644 --- a/bazel/envoy_test.bzl +++ b/bazel/envoy_test.bzl @@ -164,12 +164,14 @@ def envoy_cc_test( tags = [], args = [], copts = [], + condition = None, shard_count = None, coverage = True, local = False, size = "medium", flaky = False): coverage_tags = tags + ([] if coverage else ["nocoverage"]) + cc_test( name = name, srcs = srcs, diff --git a/docs/generate_extension_db.py b/docs/generate_extension_db.py index 79bfe5fad6c9..de6172015ab9 100755 --- a/docs/generate_extension_db.py +++ b/docs/generate_extension_db.py @@ -55,11 +55,9 @@ def GetExtensionMetadata(target): if __name__ == '__main__': output_path = sys.argv[1] extension_db = {} - # Include all extensions from both EXTENSIONS and - # DISABLED_BY_DEFAULT_EXTENSIONS in source/extensions/extensions_build_config.bzl + # Include all extensions from source/extensions/extensions_build_config.bzl all_extensions = {} all_extensions.update(extensions_build_config.EXTENSIONS) - all_extensions.update(extensions_build_config.DISABLED_BY_DEFAULT_EXTENSIONS) for extension, target in all_extensions.items(): extension_db[extension] = GetExtensionMetadata(target) # The TLS and generic upstream extensions are hard-coded into the build, so diff --git a/docs/root/configuration/http/http_filters/kill_request_filter.rst b/docs/root/configuration/http/http_filters/kill_request_filter.rst index a391baa56bb1..85b55fb2347b 100644 --- a/docs/root/configuration/http/http_filters/kill_request_filter.rst +++ b/docs/root/configuration/http/http_filters/kill_request_filter.rst @@ -4,7 +4,8 @@ Kill Request =============== The KillRequest filter can be used to crash Envoy when receiving a Kill request. -By default, KillRequest filter is not built into Envoy binary since it is included in *DISABLED_BY_DEFAULT_EXTENSIONS* in *extensions_build_config.bzl*. If you want to use this extension, please move it from *DISABLED_BY_DEFAULT_EXTENSIONS* to *EXTENSIONS*. +By default, KillRequest filter is not built into Envoy binary. If you want to use this extension, +build Envoy with `--//source/extensions/filters/http/kill_request:enabled`. Configuration ------------- diff --git a/source/extensions/all_extensions.bzl b/source/extensions/all_extensions.bzl index b054211ca3e0..7e7492938c1c 100644 --- a/source/extensions/all_extensions.bzl +++ b/source/extensions/all_extensions.bzl @@ -1,7 +1,5 @@ load("@bazel_skylib//lib:dicts.bzl", "dicts") -load("@envoy_build_config//:extensions_build_config.bzl", "DISABLED_BY_DEFAULT_EXTENSIONS", "EXTENSIONS") - -GLOBAL_DENYLIST = DISABLED_BY_DEFAULT_EXTENSIONS.keys() +load("@envoy_build_config//:extensions_build_config.bzl", "EXTENSIONS") # These extensions are registered using the extension system but are required for the core Envoy build. # The map may be overridden by extensions specified in envoy_build_config. @@ -10,14 +8,16 @@ _required_extensions = { "envoy.transport_sockets.tls": "//source/extensions/transport_sockets/tls:config", } +# Return the extension cc_library target after select +def _selected_extension_target(target): + return target + "_envoy_extension" + # Return all extensions to be compiled into Envoy. def envoy_all_extensions(denylist = []): all_extensions = dicts.add(_required_extensions, EXTENSIONS) - denylist = denylist + GLOBAL_DENYLIST - # These extensions can be removed on a site specific basis. - return [v for k, v in all_extensions.items() if not k in denylist] + return [_selected_extension_target(v) for k, v in all_extensions.items() if not k in denylist] # Core extensions needed to run Envoy's integration tests. _core_extensions = [ @@ -41,7 +41,7 @@ _http_filter_prefix = "envoy.filters.http" def envoy_all_http_filters(): all_extensions = dicts.add(_required_extensions, EXTENSIONS) - return [v for k, v in all_extensions.items() if k.startswith(_http_filter_prefix) and k not in GLOBAL_DENYLIST] + return [_selected_extension_target(v) for k, v in all_extensions.items() if k.startswith(_http_filter_prefix)] # All network-layer filters are extensions with names that have the following prefix. _network_filter_prefix = "envoy.filters.network" @@ -53,4 +53,4 @@ _thrift_filter_prefix = "envoy.filters.thrift" def envoy_all_network_filters(): all_extensions = dicts.add(_required_extensions, EXTENSIONS) - return [v for k, v in all_extensions.items() if (k.startswith(_network_filter_prefix) or k.startswith(_thrift_filter_prefix)) and k not in GLOBAL_DENYLIST] + return [_selected_extension_target(v) for k, v in all_extensions.items() if (k.startswith(_network_filter_prefix) or k.startswith(_thrift_filter_prefix))] diff --git a/source/extensions/extensions_build_config.bzl b/source/extensions/extensions_build_config.bzl index 556b32ad14ef..c93110142fd6 100644 --- a/source/extensions/extensions_build_config.bzl +++ b/source/extensions/extensions_build_config.bzl @@ -71,9 +71,11 @@ EXTENSIONS = { "envoy.filters.http.health_check": "//source/extensions/filters/http/health_check:config", "envoy.filters.http.ip_tagging": "//source/extensions/filters/http/ip_tagging:config", "envoy.filters.http.jwt_authn": "//source/extensions/filters/http/jwt_authn:config", + # Disabled by default + "envoy.filters.http.kill_request": "//source/extensions/filters/http/kill_request:kill_request_config", "envoy.filters.http.local_ratelimit": "//source/extensions/filters/http/local_ratelimit:config", "envoy.filters.http.lua": "//source/extensions/filters/http/lua:config", - "envoy.filters.http.oauth2": "//source/extensions/filters/http/oauth2:config", + "envoy.filters.http.oauth2": "//source/extensions/filters/http/oauth2:config", "envoy.filters.http.on_demand": "//source/extensions/filters/http/on_demand:config", "envoy.filters.http.original_src": "//source/extensions/filters/http/original_src:config", "envoy.filters.http.ratelimit": "//source/extensions/filters/http/ratelimit:config", @@ -227,11 +229,6 @@ EXTENSIONS = { "envoy.wasm.runtime.wasmtime": "//source/extensions/wasm_runtime/wasmtime:config", } -# These filters will not be built into Envoy by default. To build Envoy with any of these filter, please move it to EXTENSIONS. -DISABLED_BY_DEFAULT_EXTENSIONS = { - "envoy.filters.http.kill_request": "//source/extensions/filters/http/kill_request:kill_request_config", -} - # These can be changed to ["//visibility:public"], for downstream builds which # need to directly reference Envoy extensions. EXTENSION_CONFIG_VISIBILITY = ["//:extension_config"] diff --git a/source/extensions/filters/http/kill_request/BUILD b/source/extensions/filters/http/kill_request/BUILD index aa37e09f6a70..6fa2cc297e89 100644 --- a/source/extensions/filters/http/kill_request/BUILD +++ b/source/extensions/filters/http/kill_request/BUILD @@ -7,7 +7,7 @@ load( licenses(["notice"]) # Apache 2 -envoy_extension_package() +envoy_extension_package(enabled_default = False) envoy_cc_library( name = "kill_request_filter_lib", diff --git a/test/extensions/extensions_build_system.bzl b/test/extensions/extensions_build_system.bzl index e7b3f6668c17..8ab8beeef243 100644 --- a/test/extensions/extensions_build_system.bzl +++ b/test/extensions/extensions_build_system.bzl @@ -1,62 +1,47 @@ load("//bazel:envoy_build_system.bzl", "envoy_benchmark_test", "envoy_cc_benchmark_binary", "envoy_cc_mock", "envoy_cc_test", "envoy_cc_test_binary", "envoy_cc_test_library") -load("@envoy_build_config//:extensions_build_config.bzl", "DISABLED_BY_DEFAULT_EXTENSIONS", "EXTENSIONS") +load("@envoy_build_config//:extensions_build_config.bzl", "EXTENSIONS") -def extension_allowed_for_test(extension_name): - return extension_name in EXTENSIONS or extension_name in DISABLED_BY_DEFAULT_EXTENSIONS +def _skip_extension(func, name, extension_name, **kwargs): + if not extension_name in EXTENSIONS: + return + + func(name, **kwargs) # All extension tests should use this version of envoy_cc_test(). It allows compiling out # tests for extensions that the user does not wish to include in their build. -# @param extension_name should match an extension listed in EXTENSIONS or DISABLED_BY_DEFAULT_EXTENSIONS. +# @param extension_name should match an extension listed in EXTENSIONS. def envoy_extension_cc_test( name, extension_name, **kwargs): - if not extension_allowed_for_test(extension_name): - return - - envoy_cc_test(name, **kwargs) + _skip_extension(envoy_cc_test, name, extension_name, **kwargs) def envoy_extension_cc_test_library( name, extension_name, **kwargs): - if not extension_allowed_for_test(extension_name): - return - - envoy_cc_test_library(name, **kwargs) + _skip_extension(envoy_cc_test_library, name, extension_name, **kwargs) def envoy_extension_cc_mock( name, extension_name, **kwargs): - if not extension_allowed_for_test(extension_name): - return - - envoy_cc_mock(name, **kwargs) + _skip_extension(envoy_cc_mock, name, extension_name, **kwargs) def envoy_extension_cc_test_binary( name, extension_name, **kwargs): - if not extension_allowed_for_test(extension_name): - return - - envoy_cc_test_binary(name, **kwargs) + _skip_extension(envoy_cc_test_binary, name, extension_name, **kwargs) def envoy_extension_cc_benchmark_binary( name, extension_name, **kwargs): - if not extension_allowed_for_test(extension_name): - return - - envoy_cc_benchmark_binary(name, **kwargs) + _skip_extension(envoy_cc_benchmark_binary, name, extension_name, **kwargs) def envoy_extension_benchmark_test( name, extension_name, **kwargs): - if not extension_allowed_for_test(extension_name): - return - - envoy_benchmark_test(name, **kwargs) + _skip_extension(envoy_benchmark_test, name, extension_name, **kwargs) diff --git a/tools/code_format/envoy_build_fixer.py b/tools/code_format/envoy_build_fixer.py index 9af90f0f7e21..03be50983744 100755 --- a/tools/code_format/envoy_build_fixer.py +++ b/tools/code_format/envoy_build_fixer.py @@ -89,7 +89,7 @@ def FixPackageAndLicense(path, contents): # Envoy package is inserted after the load block containing the # envoy_package import. package_and_parens = package_string + '()' - if package_and_parens not in contents: + if package_and_parens[:-1] not in contents: contents = re.sub(regex_to_use, r'\1\n%s\n\n' % package_and_parens, contents) if package_and_parens not in contents: raise EnvoyBuildFixerError('Unable to insert %s' % package_and_parens) diff --git a/tools/dependency/validate.py b/tools/dependency/validate.py index df4a6c43520b..92178b450074 100755 --- a/tools/dependency/validate.py +++ b/tools/dependency/validate.py @@ -144,10 +144,7 @@ def ListExtensions(self): Returns: Dictionary items from source/extensions/extensions_build_config.bzl. """ - all_extensions = {} - all_extensions.update(extensions_build_config.EXTENSIONS) - all_extensions.update(extensions_build_config.DISABLED_BY_DEFAULT_EXTENSIONS) - return all_extensions.items() + return extensions_build_config.EXTENSIONS.items() class Validator(object): From 4ef759773a58d6a9301a7ae7bc9292a4782c0bbb Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Thu, 3 Dec 2020 02:33:41 -0800 Subject: [PATCH 2/5] rename Signed-off-by: Lizan Zhou --- test/extensions/extensions_build_system.bzl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/extensions/extensions_build_system.bzl b/test/extensions/extensions_build_system.bzl index 8ab8beeef243..244990e036bd 100644 --- a/test/extensions/extensions_build_system.bzl +++ b/test/extensions/extensions_build_system.bzl @@ -1,7 +1,7 @@ load("//bazel:envoy_build_system.bzl", "envoy_benchmark_test", "envoy_cc_benchmark_binary", "envoy_cc_mock", "envoy_cc_test", "envoy_cc_test_binary", "envoy_cc_test_library") load("@envoy_build_config//:extensions_build_config.bzl", "EXTENSIONS") -def _skip_extension(func, name, extension_name, **kwargs): +def _apply_to_extension_allow_for_test(func, name, extension_name, **kwargs): if not extension_name in EXTENSIONS: return @@ -14,34 +14,34 @@ def envoy_extension_cc_test( name, extension_name, **kwargs): - _skip_extension(envoy_cc_test, name, extension_name, **kwargs) + _apply_to_extension_allow_for_test(envoy_cc_test, name, extension_name, **kwargs) def envoy_extension_cc_test_library( name, extension_name, **kwargs): - _skip_extension(envoy_cc_test_library, name, extension_name, **kwargs) + _apply_to_extension_allow_for_test(envoy_cc_test_library, name, extension_name, **kwargs) def envoy_extension_cc_mock( name, extension_name, **kwargs): - _skip_extension(envoy_cc_mock, name, extension_name, **kwargs) + _apply_to_extension_allow_for_test(envoy_cc_mock, name, extension_name, **kwargs) def envoy_extension_cc_test_binary( name, extension_name, **kwargs): - _skip_extension(envoy_cc_test_binary, name, extension_name, **kwargs) + _apply_to_extension_allow_for_test(envoy_cc_test_binary, name, extension_name, **kwargs) def envoy_extension_cc_benchmark_binary( name, extension_name, **kwargs): - _skip_extension(envoy_cc_benchmark_binary, name, extension_name, **kwargs) + _apply_to_extension_allow_for_test(envoy_cc_benchmark_binary, name, extension_name, **kwargs) def envoy_extension_benchmark_test( name, extension_name, **kwargs): - _skip_extension(envoy_benchmark_test, name, extension_name, **kwargs) + _apply_to_extension_allow_for_test(envoy_benchmark_test, name, extension_name, **kwargs) From 39a3efd0fd567ec85edc9ddaeb7a4f2bc1655ee9 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Fri, 4 Dec 2020 02:33:46 -0800 Subject: [PATCH 3/5] add test Signed-off-by: Lizan Zhou --- ci/do_ci.sh | 4 ++- test/exe/BUILD | 11 +++++- test/exe/extra_extensions_test.cc | 28 +++++++++++++++ test/exe/main_common_test.cc | 11 ------ test/exe/testdata/BUILD | 15 -------- .../test_with_kill_request_filter.yaml | 34 ------------------- 6 files changed, 41 insertions(+), 62 deletions(-) create mode 100644 test/exe/extra_extensions_test.cc delete mode 100644 test/exe/testdata/BUILD delete mode 100644 test/exe/testdata/test_with_kill_request_filter.yaml diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 4e50799105e1..0bc181d5407c 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -284,7 +284,9 @@ elif [[ "$CI_TARGET" == "bazel.compile_time_options" ]]; then "--define" "deprecated_features=disabled" "--define" "use_new_codecs_in_integration_tests=false" "--define" "tcmalloc=gperftools" - "--define" "zlib=ng") + "--define" "zlib=ng" + "--//source/extensions/filters/http/kill_request:enabled" + "--test_env=ENVOY_HAS_EXTRA_EXTENSIONS=true") ENVOY_STDLIB="${ENVOY_STDLIB:-libstdc++}" setup_clang_toolchain diff --git a/test/exe/BUILD b/test/exe/BUILD index 74178f65337c..fecb3ce40418 100644 --- a/test/exe/BUILD +++ b/test/exe/BUILD @@ -64,7 +64,6 @@ envoy_cc_test( srcs = ["main_common_test.cc"], data = [ "//test/config/integration:google_com_proxy_port_0", - "//test/exe/testdata:test_with_kill_request_filter", ], deps = [ "//source/common/api:api_lib", @@ -75,6 +74,16 @@ envoy_cc_test( ], ) +envoy_cc_test( + name = "extra_extensions_test", + srcs = ["extra_extensions_test.cc"], + deps = [ + # This dependency MUST be main_common_lib to meet the purpose of this test + "//source/exe:main_common_lib", + "//test/test_common:environment_lib", + ], +) + envoy_cc_test( name = "terminate_handler_test", srcs = ["terminate_handler_test.cc"], diff --git a/test/exe/extra_extensions_test.cc b/test/exe/extra_extensions_test.cc new file mode 100644 index 000000000000..809a8f458e41 --- /dev/null +++ b/test/exe/extra_extensions_test.cc @@ -0,0 +1,28 @@ +#include "envoy/common/exception.h" +#include "envoy/registry/registry.h" +#include "envoy/server/filter_config.h" + +#include "test/test_common/environment.h" +#include "test/test_common/utility.h" + +#include "gtest/gtest.h" + +#include +#include + +namespace Envoy { +namespace { + +// Verify KillRequest filter is not built into Envoy by default but in compile_time_options +TEST(ExtraExtensionsTest, KillRequestFilterIsNotBuiltByDefault) { + auto* factory = Registry::FactoryRegistry:: + getFactoryByType("envoy.extensions.filters.http.kill_request.v3.KillRequest"); + if (TestEnvironment::getOptionalEnvVar("ENVOY_HAS_EXTRA_EXTENSIONS").value_or("") == "true") { + EXPECT_NE(nullptr, factory); + } else { + EXPECT_EQ(nullptr, factory); + } +} + +} // namespace +} // namespace Envoy diff --git a/test/exe/main_common_test.cc b/test/exe/main_common_test.cc index 9685b6c66250..8428cf6b43fe 100644 --- a/test/exe/main_common_test.cc +++ b/test/exe/main_common_test.cc @@ -455,15 +455,4 @@ TEST_P(MainCommonTest, ConstructDestructLogger) { Logger::Registry::getSink()->log(log_msg); } -// Verify KillRequest filter is not built into Envoy by default. -TEST_P(MainCommonTest, KillRequestFilterIsNotBuiltByDefault) { - config_file_ = TestEnvironment::temporaryFileSubstitute( - "test/exe/testdata/test_with_kill_request_filter.yaml", TestEnvironment::ParamMap(), - TestEnvironment::PortMap(), GetParam()); - argv_ = {"envoy-static", "--use-dynamic-base-id", "-c", config_file_.c_str(), nullptr}; - - EXPECT_THROW_WITH_REGEX(MainCommon main_common(argc(), argv()), EnvoyException, - "unknown type: envoy.extensions.filters.http.kill_request"); -} - } // namespace Envoy diff --git a/test/exe/testdata/BUILD b/test/exe/testdata/BUILD deleted file mode 100644 index 751268c411bc..000000000000 --- a/test/exe/testdata/BUILD +++ /dev/null @@ -1,15 +0,0 @@ -load( - "//bazel:envoy_build_system.bzl", - "envoy_package", -) - -licenses(["notice"]) # Apache 2 - -envoy_package() - -filegroup( - name = "test_with_kill_request_filter", - srcs = [ - "test_with_kill_request_filter.yaml", - ], -) diff --git a/test/exe/testdata/test_with_kill_request_filter.yaml b/test/exe/testdata/test_with_kill_request_filter.yaml deleted file mode 100644 index 4eb8b0d8bde3..000000000000 --- a/test/exe/testdata/test_with_kill_request_filter.yaml +++ /dev/null @@ -1,34 +0,0 @@ -admin: - access_log_path: "{{ null_device_path }}" - address: - socket_address: - address: "{{ ip_any_address }}" - port_value: 0 - -static_resources: - listeners: - - name: listener_0 - address: - socket_address: - address: "{{ ip_any_address }}" - port_value: 0 - filter_chains: - - filters: - - name: http - typed_config: - "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager - stat_prefix: ingress_http - codec_type: AUTO - route_config: - name: local_route - virtual_hosts: - - name: local_service - domains: ["*"] - http_filters: - - name: envoy.filters.http.kill_request - typed_config: - "@type": type.googleapis.com/envoy.extensions.filters.http.kill_request.v3.KillRequest - - name: envoy.filters.http.router - typed_config: - "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router - From c5e3e44085bffc049cf011cc74753c838cd0323d Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Fri, 4 Dec 2020 14:52:52 -0800 Subject: [PATCH 4/5] format Signed-off-by: Lizan Zhou --- test/exe/extra_extensions_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/exe/extra_extensions_test.cc b/test/exe/extra_extensions_test.cc index 809a8f458e41..9224f1d27a5a 100644 --- a/test/exe/extra_extensions_test.cc +++ b/test/exe/extra_extensions_test.cc @@ -1,3 +1,6 @@ +#include +#include + #include "envoy/common/exception.h" #include "envoy/registry/registry.h" #include "envoy/server/filter_config.h" @@ -7,9 +10,6 @@ #include "gtest/gtest.h" -#include -#include - namespace Envoy { namespace { From c7851731a2ce74d0c83bd129b9938c3f9c9c64ca Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Sat, 5 Dec 2020 02:19:18 -0800 Subject: [PATCH 5/5] fix Signed-off-by: Lizan Zhou --- ci/do_ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 0bc181d5407c..f50a538c1958 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -285,7 +285,7 @@ elif [[ "$CI_TARGET" == "bazel.compile_time_options" ]]; then "--define" "use_new_codecs_in_integration_tests=false" "--define" "tcmalloc=gperftools" "--define" "zlib=ng" - "--//source/extensions/filters/http/kill_request:enabled" + "--@envoy//source/extensions/filters/http/kill_request:enabled" "--test_env=ENVOY_HAS_EXTRA_EXTENSIONS=true") ENVOY_STDLIB="${ENVOY_STDLIB:-libstdc++}"