Skip to content

Commit

Permalink
fix(balancer) set target status using hostname
Browse files Browse the repository at this point in the history
When target is added using hostname, it was not possible to update its
health status using only the hostname. This change fixes that issue.
  • Loading branch information
locao committed May 18, 2022
1 parent ce5e6a2 commit fba1993
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kong/runloop/balancer/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ local function post_health(upstream, hostname, ip, port, is_healthy)
end

local ok, err
if ip then
if ip and (utils.hostname_type(ip) ~= "name") then
ok, err = healthchecker:set_target_status(ip, port, hostname, is_healthy)
else
ok, err = healthchecker:set_all_target_statuses_for_hostname(hostname, port, is_healthy)
Expand Down

0 comments on commit fba1993

Please sign in to comment.