Skip to content

Commit

Permalink
shorten unix domain socket names
Browse files Browse the repository at this point in the history
  • Loading branch information
brentos committed Aug 23, 2024
1 parent 23da95d commit 8abc5ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
14 changes: 7 additions & 7 deletions kong/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ local constants = {

SOCKET_DIRECTORY = "sockets",
SOCKETS = {
WORKER_EVENTS = "worker_events.sock",
STREAM_WORKER_EVENTS = "stream_worker_events.sock",
CLUSTER_PROXY_SSL_TERMINATOR = "cluster_proxy_ssl_terminator.sock",
STREAM_CONFIG = "stream_config.sock",
STREAM_TLS_TERMINATE = "stream_tls_terminate.sock",
STREAM_TLS_PASSTHROUGH = "stream_tls_passthrough.sock",
STREAM_RPC = "stream_rpc.sock",
WORKER_EVENTS = "we",
STREAM_WORKER_EVENTS = "sw",
CLUSTER_PROXY_SSL_TERMINATOR = "cp",
STREAM_CONFIG = "sc",
STREAM_TLS_TERMINATE = "st",
STREAM_TLS_PASSTHROUGH = "sp",
STREAM_RPC = "rp",
},
}

Expand Down
5 changes: 2 additions & 3 deletions spec/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3831,9 +3831,8 @@ local function cleanup_kong(prefix, preserve_prefix, preserve_dc)
prefix = prefix or conf.prefix
local socket_path = pl_path.join(prefix, constants.SOCKET_DIRECTORY)
for child in lfs.dir(socket_path) do
-- TODO: use alternative method to remove socket files; maybe loop through SOCKETS constant
if child:sub(-5) == ".sock" then
local path = pl_path.join(socket_path, child)
local path = pl_path.join(socket_path, child)
if lfs.attributes(path, "mode") == "socket" then
os.remove(path)
end
end
Expand Down

0 comments on commit 8abc5ea

Please sign in to comment.