This is an automated email from the ASF dual-hosted git repository.
tokers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new e1d9f35 change: rename plugin's balancer method to before_proxy
(#4697)
e1d9f35 is described below
commit e1d9f35f606ad11a980ed4bf33d5ba8712e8f6de
Author: 罗泽轩 <[email protected]>
AuthorDate: Thu Jul 29 19:06:14 2021 +0800
change: rename plugin's balancer method to before_proxy (#4697)
This is confusing to have plugin's balancer method and user-defined
balancer.
Signed-off-by: spacewander <[email protected]>
---
apisix/balancer.lua | 2 +-
apisix/init.lua | 8 ++++----
apisix/plugins/serverless/init.lua | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/apisix/balancer.lua b/apisix/balancer.lua
index fde2e58..22d0117 100644
--- a/apisix/balancer.lua
+++ b/apisix/balancer.lua
@@ -321,7 +321,7 @@ function _M.run(route, ctx, plugin_funcs)
end
end
- local _, run = plugin_funcs("balancer")
+ local _, run = plugin_funcs("before_proxy")
-- always recreate request as the request may be changed by plugins
if (run or header_changed) and balancer.recreate_request then
balancer.recreate_request()
diff --git a/apisix/init.lua b/apisix/init.lua
index 6556151..f67d14c 100644
--- a/apisix/init.lua
+++ b/apisix/init.lua
@@ -518,8 +518,8 @@ function _M.http_access_phase()
set_upstream_headers(api_ctx, server)
- -- run the balancer phase in access phase first to avoid always reinit
request
- common_phase("balancer")
+ -- run the before_proxy method in access phase first to avoid always
reinit request
+ common_phase("before_proxy")
local ref = ctxdump.stash_ngx_ctx()
core.log.info("stash ngx ctx: ", ref)
@@ -913,8 +913,8 @@ function _M.stream_preread_phase()
api_ctx.picked_server = server
- -- run the balancer phase in preread phase first to avoid always reinit
request
- common_phase("balancer")
+ -- run the before_proxy method in preread phase first to avoid always
reinit request
+ common_phase("before_proxy")
end
diff --git a/apisix/plugins/serverless/init.lua
b/apisix/plugins/serverless/init.lua
index 253a4ac..ef3c222 100644
--- a/apisix/plugins/serverless/init.lua
+++ b/apisix/plugins/serverless/init.lua
@@ -113,7 +113,7 @@ return function(plugin_name, priority)
call_funcs('access', conf, ctx)
end
- function _M.balancer(conf, ctx)
+ function _M.before_proxy(conf, ctx)
call_funcs('balancer', conf, ctx)
end