ngx_wasm_module icon indicating copy to clipboard operation
ngx_wasm_module copied to clipboard

Update our Lua bridge resolver to use the new Kong DNS resolver

Open thibaultcha opened this issue 1 year ago • 3 comments

See the new DNS resolver library enabled on-demand in Kong 3.x series: https://github.com/Kong/kong/pull/12305

And our invocation of the Kong resolver from Wasm filters: https://github.com/Kong/ngx_wasm_module/blob/prerelease-0.4.0/src/common/lua/ngx_wasm_lua_resolver.c#L45-L71

We will need to update our Lua code to use the appropriate resolver depending on Kong's configuration.

thibaultcha avatar Jul 16 '24 23:07 thibaultcha

Haven't looked closely at the new DNS resolver yet; I'm guessing some of its API has diverged from resty.dns.client?

If so, would it be more appropriate for us to handle this within Kong gateway by putting a compat shim around the new DNS resolver? This way ngx_wasm_module can remain fully compatible with resty.dns.client?

flrgh avatar Jul 18 '24 15:07 flrgh

Thanks for looking into it! Either way sounds good to me...

thibaultcha avatar Jul 18 '24 15:07 thibaultcha

relevant: https://github.com/Kong/kong/pull/13725

The gateway now has test coverage for both new/old DNS client implementations. Under the hood the test uses /etc/hosts style hardcoding of name->ip relationship, so it's not a very deep test and won't catch things like yielding differences between the two clients, but it will certainly catch any problems that would occur from differences in the Lua API.

flrgh avatar Oct 17 '24 18:10 flrgh