Skip to content

Commit 8f88b7b

Browse files
Add method to allow retrieval of listener tag during pool configuration
1 parent caec102 commit 8f88b7b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/routelib/routelib.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ end
536536
-- routes that have stats should assign stats or global overrides in this conf
537537
-- stage.
538538
-- NOTE: we are editing the entries in-place
539-
local function main_configure_router(set, pools, c_in)
539+
local function main_configure_router(set, pools, c_in, tag)
540540
-- create ctx object to hold label + command
541541
local ctx = {
542542
label = function(self)
@@ -545,6 +545,9 @@ local function main_configure_router(set, pools, c_in)
545545
cmd = function(self)
546546
return self._cmd
547547
end,
548+
listen_tag = function(self)
549+
return self._listen_tag
550+
end,
548551
check_child = function(self, child)
549552
-- ensure this child is a string of a valid pool
550553
if type(child) ~= "string" then
@@ -610,6 +613,7 @@ local function main_configure_router(set, pools, c_in)
610613
return id
611614
end
612615
}
616+
ctx._listen_tag = tag
613617

614618
if set.map then
615619
-- a prefix map
@@ -679,7 +683,7 @@ local function main_routes_parse(c_in, pools)
679683
end
680684
end
681685

682-
main_configure_router(set, pools, c_in)
686+
main_configure_router(set, pools, c_in, tag)
683687
found = true
684688
end
685689

0 commit comments

Comments
 (0)