Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thibaultcha opened this issue Jul 16, 2024 · 3 comments
Open

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

thibaultcha opened this issue Jul 16, 2024 · 3 comments
Assignees
Labels
area/lua-bridge Area: Lua bridge enhancement New feature or request good first issue Good for newcomers

Comments

@thibaultcha
Copy link
Member

See the new DNS resolver library enabled on-demand in Kong 3.x series: Kong/kong#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 thibaultcha added enhancement New feature or request good first issue Good for newcomers area/lua-bridge Area: Lua bridge labels Jul 16, 2024
@flrgh flrgh self-assigned this Jul 18, 2024
@flrgh
Copy link
Contributor

flrgh commented Jul 18, 2024

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?

@thibaultcha
Copy link
Member Author

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

@flrgh
Copy link
Contributor

flrgh commented Oct 17, 2024

relevant: Kong/kong#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lua-bridge Area: Lua bridge enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants