Skip to content

Commit

Permalink
Correctly format ipv6 resolver config for lua
Browse files Browse the repository at this point in the history
It seems that when support was added for parsing resolv_conf directly a regression was introduced which effectively breaks anyone with ipv6 resolvers.

Regression of kubernetes#3895
  • Loading branch information
jacksontj committed Sep 7, 2019
1 parent eac8dec commit 28a4268
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rootfs/etc/nginx/lua/util/resolv_conf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ local function parse_line(line)
local keyword, value = parts[1], parts[2]

if keyword == "nameserver" then
if not value:match("^%d+.%d+.%d+.%d+$") then
value = string.format("[%s]", value)
end
nameservers[#nameservers + 1] = value
elseif keyword == "search" then
set_search(parts)
Expand Down

0 comments on commit 28a4268

Please sign in to comment.