Skip to content

Commit

Permalink
style(tools/dns): improve code style for readability (#12808)
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw authored Apr 2, 2024
1 parent 75fa2ae commit 530753d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kong/tools/dns.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local utils = require "kong.tools.utils"
local normalize_ip = require("kong.tools.ip").normalize_ip
local dns_client


--- Load and setup the DNS client according to the provided configuration.
-- @param conf (table) Kong configuration
-- @return the initialized `resty.dns.client` module, or an error
Expand All @@ -15,7 +16,7 @@ local setup_client = function(conf)
-- servers must be reformatted as name/port sub-arrays
if conf.dns_resolver then
for i, server in ipairs(conf.dns_resolver) do
local s = utils.normalize_ip(server)
local s = normalize_ip(server)
servers[i] = { s.host, s.port or 53 } -- inserting port if omitted
end
end
Expand All @@ -41,4 +42,5 @@ local setup_client = function(conf)
return dns_client
end


return setup_client

1 comment on commit 530753d

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:530753dbb9f36738ccc85af4bcc314aacb09346a
Artifacts available https://github.com/Kong/kong/actions/runs/8516922968

Please sign in to comment.