Skip to content

Add method to allow retrieval of listener tag during pool configuration #21

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/routelib/routelib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ end
-- routes that have stats should assign stats or global overrides in this conf
-- stage.
-- NOTE: we are editing the entries in-place
local function main_configure_router(set, pools, c_in)
local function main_configure_router(set, pools, c_in, tag)
-- create ctx object to hold label + command
local ctx = {
label = function(self)
Expand All @@ -545,6 +545,9 @@ local function main_configure_router(set, pools, c_in)
cmd = function(self)
return self._cmd
end,
listen_tag = function(self)
return self._listen_tag
end,
check_child = function(self, child)
-- ensure this child is a string of a valid pool
if type(child) ~= "string" then
Expand Down Expand Up @@ -610,6 +613,7 @@ local function main_configure_router(set, pools, c_in)
return id
end
}
ctx._listen_tag = tag
Copy link
Member

Choose a reason for hiding this comment

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

is this code missing something? I don't see where tag is coming from.

Copy link
Contributor Author

@FinnitoProductions FinnitoProductions Apr 22, 2025

Choose a reason for hiding this comment

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

Sorry -- missed a couple lines when I was copying over. I'll fix it now


if set.map then
-- a prefix map
Expand Down Expand Up @@ -679,7 +683,7 @@ local function main_routes_parse(c_in, pools)
end
end

main_configure_router(set, pools, c_in)
main_configure_router(set, pools, c_in, tag)
found = true
end

Expand Down