Skip to content

Commit

Permalink
fix(wasm): re-enable Lua DNS resolver for proxy-wasm
Browse files Browse the repository at this point in the history
This was previously disabled in 9a5d48b.
  • Loading branch information
flrgh committed Jul 25, 2024
1 parent b5716b1 commit 4a16289
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
message: |
Re-enabled the Lua DNS resolver from proxy-wasm by default.
type: bugfix
scope: Configuration
3 changes: 1 addition & 2 deletions kong/conf_loader/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,7 @@ local function load(path, custom_conf, opts)
-- set it as such in kong_defaults, because it can only be used if wasm is
-- _also_ enabled. We inject it here if the user has not opted to set it
-- themselves.
-- TODO: as a temporary compatibility fix, we are forcing it to 'off'.
add_wasm_directive("nginx_http_proxy_wasm_lua_resolver", "off")
add_wasm_directive("nginx_http_proxy_wasm_lua_resolver", "on")

-- configure wasmtime module cache
if conf.role == "traditional" or conf.role == "data_plane" then
Expand Down
10 changes: 1 addition & 9 deletions spec/01-unit/04-prefix_handler_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ describe("NGINX conf compiler", function()
end)
it("injects default configurations if wasm=on", function()
assert.matches(
".+proxy_wasm_lua_resolver off;.+",
".+proxy_wasm_lua_resolver on;.+",
kong_ngx_cfg({ wasm = true, }, debug)
)
end)
Expand All @@ -986,14 +986,6 @@ describe("NGINX conf compiler", function()
}, debug)
)
end)
it("permits overriding proxy_wasm_lua_resolver to on", function()
assert.matches(
".+proxy_wasm_lua_resolver on;.+",
kong_ngx_cfg({ wasm = true,
nginx_http_proxy_wasm_lua_resolver = "on",
}, debug)
)
end)
it("injects runtime-specific directives (wasmtime)", function()
assert.matches(
"wasm {.+wasmtime {.+flag flag1 on;.+flag flag2 1m;.+}.+",
Expand Down
2 changes: 1 addition & 1 deletion spec/02-integration/20-wasm/04-proxy-wasm_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ describe("proxy-wasm filters (#wasm) (#" .. strategy .. ")", function()
assert.logfile().has.no.line("[crit]", true, 0)
end)

pending("resolves DNS hostnames to send an http dispatch, return its response body", function()
it("resolves DNS hostnames to send an http dispatch, return its response body", function()
local client = helpers.proxy_client()
finally(function() client:close() end)

Expand Down

0 comments on commit 4a16289

Please sign in to comment.