You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/07/21 01:32:18 UTC
[GitHub] [incubator-apisix] wrl96 opened a new pull request #1875: [WIP] bugfix: check plugin schema when sync data
wrl96 opened a new pull request #1875:
URL: https://github.com/apache/incubator-apisix/pull/1875
### What this PR does:
Fix #1604
### Pre-submission checklist:
* [x] Did you explain what problem does this PR solve? Or what new features have been added?
* [ ] Have you added corresponding test cases?
* [x] Have you modified the corresponding document?
* [x] Is this PR backward compatible?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-apisix] membphis commented on a change in pull request #1875: [WIP] bugfix: check plugin schema when sync data
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1875:
URL: https://github.com/apache/incubator-apisix/pull/1875#discussion_r460677250
##########
File path: apisix/core/config_etcd.lua
##########
@@ -166,6 +177,39 @@ local function sync_data(self)
", it shoud be a object")
end
+ -- check plugins schema
+ local plugins_conf = item.plugins
+ if plugins_conf then
+ for name, plugin_conf in pairs(plugins_conf) do
Review comment:
check the plugin `conf` in this way, it is not a good way.
config_etcd.lua is a basic component, it should not know the plugin.
I think we can export a new option when creating new `config_etcd` object, then we can add more check logic in `filter_func` .
Example:
```lua
core.config.new("/routes", {
automatic = true,
item_schema = core.schema.route,
filter_func = function ()
-- your code
end
filter = filter,
})
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org