feat: disable example-plugin by default (#2673)

Close #2659.
This commit is contained in:
罗泽轩 2020-11-10 08:46:54 +08:00 committed by GitHub
parent 14e544a6aa
commit 3ba6629daa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 3 deletions

View File

@ -172,7 +172,7 @@ etcd:
# read: 5000 # default 5000ms # read: 5000 # default 5000ms
plugins: # plugin list plugins: # plugin list
- example-plugin #- example-plugin
- limit-req - limit-req
- limit-count - limit-count
- limit-conn - limit-conn

View File

@ -194,7 +194,17 @@ The configuration of the plugin can be directly bound to the specified Route, or
A plugin will only be executed once in a single request, even if it is bound to multiple different objects (such as Route or Service). A plugin will only be executed once in a single request, even if it is bound to multiple different objects (such as Route or Service).
The order in which plugins are run is determined by the priority of the plugin itself, for example: [example-plugin](../apisix/plugins/example-plugin.lua#L37). The order in which plugins are run is determined by the priority of the plugin itself, for example:
```lua
local _M = {
version = 0.1,
priority = 0, -- the priority of this plugin will be 0
name = plugin_name,
schema = schema,
metadata_schema = metadata_schema,
}
```
The plugin configuration is submitted as part of Route or Service and placed under `plugins`. It internally uses the plugin name as the hash's key to hold configuration items for different plugins. The plugin configuration is submitted as part of Route or Service and placed under `plugins`. It internally uses the plugin name as the hash's key to hold configuration items for different plugins.

View File

@ -199,7 +199,17 @@ curl http://127.0.0.1:9080/apisix/admin/routes/102 -H 'X-API-KEY: edd1c9f034335f
优先级更高。 优先级更高。
一个插件在一次请求中只会执行一次,即使被同时绑定到多个不同对象中(比如 Route 或 Service 一个插件在一次请求中只会执行一次,即使被同时绑定到多个不同对象中(比如 Route 或 Service
插件运行先后顺序是根据插件自身的优先级来决定的,例如:[example-plugin](../../apisix/plugins/example-plugin.lua#L37)。 插件运行先后顺序是根据插件自身的优先级来决定的,例如:
```lua
local _M = {
version = 0.1,
priority = 0, -- 这个插件的优先级为 0
name = plugin_name,
schema = schema,
metadata_schema = metadata_schema,
}
```
插件配置作为 Route 或 Service 的一部分提交的,放到 `plugins` 下。它内部是使用插件 插件配置作为 Route 或 Service 的一部分提交的,放到 `plugins` 下。它内部是使用插件
名字作为哈希的 key 来保存不同插件的配置项。 名字作为哈希的 key 来保存不同插件的配置项。

2
t/APISIX.pm vendored
View File

@ -71,6 +71,8 @@ if ($enable_local_dns) {
my $default_yaml_config = read_file("conf/config-default.yaml"); my $default_yaml_config = read_file("conf/config-default.yaml");
$default_yaml_config =~ s/#- example-plugin/- example-plugin/;
my $user_yaml_config = read_file("conf/config.yaml"); my $user_yaml_config = read_file("conf/config.yaml");
my $ssl_crt = read_file("conf/cert/apisix.crt"); my $ssl_crt = read_file("conf/cert/apisix.crt");
my $ssl_key = read_file("conf/cert/apisix.key"); my $ssl_key = read_file("conf/cert/apisix.key");