Merge pull request #3775 from kppullin/fix-l4-dns-resolve-failures

Fix DNS lookup failures in L4 services
This commit is contained in:
Kubernetes Prow Robot 2019-02-19 11:11:48 -08:00 committed by GitHub
commit 201718ec0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 112 additions and 7 deletions

View file

@ -1,9 +1,7 @@
-- this is the Lua representation of TCP/UDP Configuration
local tcp_udp_configuration_data = ngx.shared.tcp_udp_configuration_data
local _M = {
nameservers = {}
}
local _M = {}
function _M.get_backends_data()
return tcp_udp_configuration_data:get("backends")

View file

@ -688,12 +688,19 @@ stream {
-- init modules
local ok, res
ok, res = pcall(require, "configuration")
if not ok then
error("require failed: " .. tostring(res))
else
configuration = res
configuration.nameservers = { {{ buildResolversForLua $cfg.Resolver $cfg.DisableIpv6DNS }} }
end
ok, res = pcall(require, "tcp_udp_configuration")
if not ok then
error("require failed: " .. tostring(res))
else
tcp_udp_configuration = res
tcp_udp_configuration.nameservers = { {{ buildResolversForLua $cfg.Resolver $cfg.DisableIpv6DNS }} }
end
ok, res = pcall(require, "tcp_udp_balancer")