Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
Signed-off-by: Qin Qin <qqin@google.com>
  • Loading branch information
qqustc committed Nov 30, 2020
1 parent 5865258 commit 7ca49c2
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
7 changes: 6 additions & 1 deletion docs/generate_extension_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ def GetExtensionMetadata(target):
if __name__ == '__main__':
output_path = sys.argv[1]
extension_db = {}
for extension, target in extensions_build_config.EXTENSIONS.items():
# Include all extensions from both EXTENSIONS and
# DISABLED_BY_DEFAULT_EXTENSIONS in 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
# not in source/extensions/extensions_build_config.bzl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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 remove it from *DISABLED_BY_DEFAULT_EXTENSIONS*.
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*.

Configuration
-------------
Expand Down
2 changes: 1 addition & 1 deletion source/extensions/all_extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
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]
4 changes: 1 addition & 3 deletions source/extensions/extensions_build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ 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",
# kill_request filter is included in DISABLED_BY_DEFAULT_EXTENSIONS below so that it will not be built into Envoy by default. To build Envoy with kill_request filter, please remove it from DISABLED_BY_DEFAULT_EXTENSIONS.
"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",
Expand Down Expand Up @@ -229,7 +227,7 @@ EXTENSIONS = {
"envoy.wasm.runtime.wasmtime": "//source/extensions/wasm_runtime/wasmtime:config",
}

# These filters will not be built into Envoy by default.
# 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",
}
Expand Down
16 changes: 8 additions & 8 deletions test/extensions/extensions_build_system.bzl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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")
load("@envoy_build_config//:extensions_build_config.bzl", "DISABLED_BY_DEFAULT_EXTENSIONS", "EXTENSIONS")

# 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.
# @param extension_name should match an extension listed in EXTENSIONS or DISABLED_BY_DEFAULT_EXTENSIONS.
def envoy_extension_cc_test(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS:
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
return

envoy_cc_test(name, **kwargs)
Expand All @@ -17,7 +17,7 @@ def envoy_extension_cc_test_library(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS:
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
return

envoy_cc_test_library(name, **kwargs)
Expand All @@ -26,7 +26,7 @@ def envoy_extension_cc_mock(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS:
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
return

envoy_cc_mock(name, **kwargs)
Expand All @@ -35,7 +35,7 @@ def envoy_extension_cc_test_binary(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS:
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
return

envoy_cc_test_binary(name, **kwargs)
Expand All @@ -44,7 +44,7 @@ def envoy_extension_cc_benchmark_binary(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS:
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
return

envoy_cc_benchmark_binary(name, **kwargs)
Expand All @@ -53,7 +53,7 @@ def envoy_extension_benchmark_test(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS:
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
return

envoy_benchmark_test(name, **kwargs)
5 changes: 4 additions & 1 deletion tools/dependency/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ def ListExtensions(self):
Returns:
Dictionary items from source/extensions/extensions_build_config.bzl.
"""
return extensions_build_config.EXTENSIONS.items()
all_extensions = {}
all_extensions.update(extensions_build_config.EXTENSIONS)
all_extensions.update(extensions_build_config.DISABLED_BY_DEFAULT_EXTENSIONS)
return all_extensions.items()


class Validator(object):
Expand Down

0 comments on commit 7ca49c2

Please sign in to comment.