biakecw commented on code in PR #8219:
URL: https://github.com/apache/apisix/pull/8219#discussion_r1023722675
##########
apisix/admin/stream_routes.lua:
##########
@@ -16,15 +16,38 @@
--
local core = require("apisix.core")
local utils = require("apisix.admin.utils")
+local iterate_values = require("apisix.core.config_util").iterate_values
local stream_route_checker =
require("apisix.stream.router.ip_port").stream_route_checker
local tostring = tostring
+local table = table
+local tonumber = tonumber
local _M = {
version = 0.1,
need_v3_filter = true,
}
+local function check_router_refer(items, id)
+ local warn_message = nil
+ local refer_list = core.tablepool.fetch("refer_list", #items, 0)
+ for _, item in iterate_values(items) do
+ if item.value == nil then
+ goto CONTINUE
+ end
+ local route = item.value
+ if route.protocol and route.protocol.superior_id and
route.protocol.superior_id == id then
+ table.insert(refer_list, item["key"])
+ end
+ ::CONTINUE::
+ end
+ if #refer_list > 0 then
+ warn_message = "/stream_routes/" .. id .. " is referred by "
+ .. table.concat(refer_list,";;")
Review Comment:
No particular reason
If there are relevant specification requirements, I will update
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]