spacewander commented on code in PR #7926:
URL: https://github.com/apache/apisix/pull/7926#discussion_r973879177
##########
apisix/admin/init.lua:
##########
@@ -258,17 +258,21 @@ local function sync_local_conf_to_etcd(reset)
local local_conf = core.config.local_conf()
local plugins = {}
- for _, name in ipairs(local_conf.plugins) do
- core.table.insert(plugins, {
- name = name,
- })
+ if local_conf.plugins then
+ for _, name in ipairs(local_conf.plugins) do
+ core.table.insert(plugins, {
+ name = name,
+ })
+ end
end
- for _, name in ipairs(local_conf.stream_plugins) do
- core.table.insert(plugins, {
- name = name,
- stream = true,
- })
+ if local_conf.stream_plugins then
Review Comment:
Maybe we can add a default empty array in
https://github.com/apache/apisix/blob/9129572f6302300ddeee3f2234393445d8ead781/apisix/cli/schema.lua#L247?
So that we don't need to introduce extra checks.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]