Skip to content
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

feat: disable node-status by default #2968

Merged
merged 1 commit into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/config-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ plugins: # plugin list (sorted in alphabetical order)
- limit-count
- limit-req
#- log-rotate
- node-status
#- node-status
- openid-connect
- prometheus
- proxy-cache
Expand Down
2 changes: 1 addition & 1 deletion doc/plugins/node-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ You may need to use [interceptors](../plugin-interceptors.md) to protect it.

## How To Enable

1. Configure `node-status` in the plugin list of the configuration file `apisix/conf/config.yaml`,
1. Configure `node-status` in the plugin list of the configuration file `conf/config.yaml`,
then you can add this plugin in any route.

```
Expand Down
2 changes: 1 addition & 1 deletion doc/zh-cn/plugins/node-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

## 启用插件

1. 配置文件 `apisix/conf/config.yaml` 的 plugin list 中配置 `node-status`
1. 配置文件 `conf/config.yaml` 的 plugin list 中配置 `node-status`

```
plugins: # plugin list
Expand Down
5 changes: 4 additions & 1 deletion t/admin/plugins.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ __DATA__
--- request
GET /apisix/admin/plugins/list
--- response_body_like eval
qr/\["zipkin","request-id","fault-injection","serverless-pre-function","batch-requests","cors","ip-restriction","referer-restriction","uri-blocker","request-validation","openid-connect","wolf-rbac","hmac-auth","basic-auth","jwt-auth","key-auth","consumer-restriction","authz-keycloak","proxy-mirror","proxy-cache","proxy-rewrite","api-breaker","limit-conn","limit-count","limit-req","node-status","redirect","response-rewrite","grpc-transcode","prometheus","echo","http-logger","sls-logger","tcp-logger","kafka-logger","syslog","udp-logger","example-plugin","serverless-post-function"\]/
qr/\["zipkin","request-id","fault-injection","serverless-pre-function","batch-requests","cors","ip-restriction","referer-restriction","uri-blocker","request-validation","openid-connect","wolf-rbac","hmac-auth","basic-auth","jwt-auth","key-auth","consumer-restriction","authz-keycloak","proxy-mirror","proxy-cache","proxy-rewrite","api-breaker","limit-conn","limit-count","limit-req","redirect","response-rewrite","grpc-transcode","prometheus","echo","http-logger","sls-logger","tcp-logger","kafka-logger","syslog","udp-logger","example-plugin","serverless-post-function"\]/
--- no_error_log
[error]

Expand Down Expand Up @@ -79,6 +79,9 @@ GET /apisix/admin/plugins


=== TEST 4: get plugin node-status schema
--- extra_yaml_config
plugins:
- node-status
--- config
location /t {
content_by_lua_block {
Expand Down
3 changes: 3 additions & 0 deletions t/admin/schema.t
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ qr/"disable":\{"type":"boolean"\}/


=== TEST 14: get plugin node-status schema
--- extra_yaml_config
plugins:
- node-status
--- request
GET /apisix/admin/schema/plugins/node-status
--- response_body eval
Expand Down
1 change: 0 additions & 1 deletion t/debug/debug-mode.t
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ loaded plugin and sort by priority: 1005 name: api-breaker
loaded plugin and sort by priority: 1003 name: limit-conn
loaded plugin and sort by priority: 1002 name: limit-count
loaded plugin and sort by priority: 1001 name: limit-req
loaded plugin and sort by priority: 1000 name: node-status
loaded plugin and sort by priority: 900 name: redirect
loaded plugin and sort by priority: 899 name: response-rewrite
loaded plugin and sort by priority: 506 name: grpc-transcode
Expand Down
13 changes: 13 additions & 0 deletions t/plugin/node-status.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@
#
use t::APISIX 'no_plan';

add_block_preprocessor(sub {
my ($block) = @_;

my $extra_yaml_config = <<_EOC_;
plugins:
- node-status
_EOC_

$block->set_value("extra_yaml_config", $extra_yaml_config);

$block;
});

master_on();
repeat_each(1);
no_long_string();
Expand Down