Skip to content

Commit 19623d7

Browse files
author
georgeji
committed
fix lint
1 parent b066a7e commit 19623d7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

apisix/discovery/consul/init.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,12 @@ function _M.connect(premature, consul_server, retry_delay)
511511
local nodes = up_services[service_name]
512512
local nodes_uniq = {}
513513
for _, node in ipairs(result.body) do
514-
if not node.Service then
514+
local service = node.Service
515+
if not service then
515516
goto CONTINUE
516517
end
517518

518-
local svc_address, svc_port, metadata = node.Service.Address, node.Service.Port, node.Service.Meta
519+
local svc_address, svc_port, metadata = service.Address, service.Port, service.Meta
519520
-- Handle nil or 0 port case - default to 80 for HTTP services
520521
if not svc_port or svc_port == 0 then
521522
svc_port = 80

apisix/upstream.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,10 @@ function _M.set_by_route(route, api_ctx)
342342
if up_conf.metadata_match then
343343
new_nodes = match_nodes_by_metadata(new_nodes, up_conf.metadata_match)
344344
if #new_nodes == 0 then
345-
return HTTP_CODE_UPSTREAM_UNAVAILABLE, "no matched upstream node after metadata matching"
345+
return HTTP_CODE_UPSTREAM_UNAVAILABLE, "no matched node filterd by metadata_match"
346346
end
347+
core.log.info("filterd by metadata_match: ", core.json.delay_encode(new_nodes, true))
347348
end
348-
core.log.info("new_nodes: ", core.json.delay_encode(new_nodes, true))
349349

350350
local same = upstream_util.compare_upstream_node(up_conf, new_nodes)
351351
if not same then

0 commit comments

Comments
 (0)