Yiyiyimu commented on a change in pull request #2036:
URL: https://github.com/apache/apisix/pull/2036#discussion_r475199087
##########
File path: apisix/core/config_etcd.lua
##########
@@ -268,86 +289,90 @@ local function sync_data(self)
return false, err
end
- local key = short_key(self, res.key)
- if res.value and type(res.value) ~= "table" then
- self:upgrade_version(res.modifiedIndex)
- return false, "invalid item data of [" .. self.key .. "/" .. key
- .. "], val: " .. tostring(res.value)
- .. ", it shoud be a object"
- end
-
- if res.value and self.item_schema then
- local ok, err = check_schema(self.item_schema, res.value)
- if not ok then
+ local res_copy = res
+ for _, res in ipairs(res_copy) do
+ local key = short_key(self, res.key)
+ if res.value and type(res.value) ~= "table" then
self:upgrade_version(res.modifiedIndex)
-
- return false, "failed to check item data of ["
- .. self.key .. "] err:" .. err
+ return false, "invalid item data of [" .. self.key .. "/" .. key
+ .. "], val: " .. tostring(res.value)
Review comment:
Thank you! Both fixed
----------------------------------------------------------------
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:
[email protected]