nic-6443 commented on code in PR #13513:
URL: https://github.com/apache/apisix/pull/13513#discussion_r3397089790
##########
apisix/discovery/consul/client.lua:
##########
@@ -394,7 +394,9 @@ function _M.fetch_services_from_server(consul_server,
options)
local nodes_uniq = {}
for _, node in ipairs(result.body) do
if not node.Service then
- goto CONTINUE
+ log.warn("invalid consul service entry without Service
field, ",
+ "skip it: ", json_delay_encode(node))
+ goto CONTINUE_NODE
Review Comment:
This is the standard Lua continue idiom and compiles fine — a goto may
target a label at the end of a block even past local declarations, since the
locals' scope ends right before such a label (Lua 5.2 manual §3.3.4 visibility
rules; LuaJIT behaves the same). The outer loop in this very function already
does this with `::CONTINUE::` jumping over `local nodes`/`local nodes_uniq`,
and the new test exercises this exact path.
--
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]