Skip to content

Commit

Permalink
fix(serf) properly set the admin IP in the Serf script
Browse files Browse the repository at this point in the history
  • Loading branch information
dheerajdwivedi authored and subnetmarco committed Jan 18, 2017
1 parent 45f6b01 commit 1fe629f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kong/cmd/utils/prefix_handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,13 @@ local function prepare_prefix(kong_config, nginx_custom_template_path)
if not resty_bin then return nil, err end

log.verbose("saving serf shell script handler to %s", kong_config.serf_event)
local script = fmt(script_template, "127.0.0.1", kong_config.admin_port, resty_bin)
-- setting serf admin ip
local admin_ip = kong_config.admin_ip
if kong_config.admin_ip == "0.0.0.0" then
admin_ip = "127.0.0.1"
end
-- saving serf script handler
local script = fmt(script_template, admin_ip, kong_config.admin_port, resty_bin)
pl_file.write(kong_config.serf_event, script)
local ok, _, _, stderr = pl_utils.executeex("chmod +x "..kong_config.serf_event)
if not ok then return nil, stderr end
Expand Down

0 comments on commit 1fe629f

Please sign in to comment.