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 26, 2020
1 parent a93c2f1 commit 5865258
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
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 removed from *envoy_all_extensions()* in *all_extensions.bzl*. If you want to use this extension, please add it in *envoy_all_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 remove it from *DISABLED_BY_DEFAULT_EXTENSIONS*.

Configuration
-------------
Expand Down
11 changes: 5 additions & 6 deletions source/extensions/all_extensions.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
load("@bazel_skylib//lib:dicts.bzl", "dicts")
load("@envoy_build_config//:extensions_build_config.bzl", "EXTENSIONS")
load("@envoy_build_config//:extensions_build_config.bzl", "DISABLED_BY_DEFAULT_EXTENSIONS", "EXTENSIONS")

GLOBAL_DENYLIST = [k for k, v in DISABLED_BY_DEFAULT_EXTENSIONS.items()]

# 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.
Expand All @@ -8,14 +10,11 @@ _required_extensions = {
"envoy.transport_sockets.tls": "//source/extensions/transport_sockets/tls:config",
}

_kill_request_http_filter = "envoy.filters.http.kill_request"

# Return all extensions to be compiled into Envoy.
def envoy_all_extensions(denylist = []):
all_extensions = dicts.add(_required_extensions, EXTENSIONS)

# !!! kill_request filter should not be built into Envoy. !!!
denylist = denylist + [_kill_request_http_filter]
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]
Expand All @@ -42,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 != _kill_request_http_filter]
return [v for k, v in all_extensions.items() if k.startswith(_http_filter_prefix) and k not in GLOBAL_DENYLIST]

# All network-layer filters are extensions with names that have the following prefix.
_network_filter_prefix = "envoy.filters.network"
Expand Down
6 changes: 4 additions & 2 deletions source/extensions/extensions_build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ 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 @@ -227,9 +229,9 @@ EXTENSIONS = {
"envoy.wasm.runtime.wasmtime": "//source/extensions/wasm_runtime/wasmtime:config",
}

# These filters will not be built into Envoy by default.
DISABLED_BY_DEFAULT_EXTENSIONS = {
# kill_request filter is excluded from envoy_all_extensions() in all_extensions.bzl so that it will not be built into Envoy by default. To build Envoy with kill_request filter, please include it in envoy_all_extensions().
"envoy.filters.http.kill_request": "//third_party/envoy/src/source/extensions/filters/http/kill_request:kill_request_config",
"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
Expand Down

0 comments on commit 5865258

Please sign in to comment.