kingluo commented on code in PR #9334:
URL: https://github.com/apache/apisix/pull/9334#discussion_r1196102608
##########
apisix/router.lua:
##########
@@ -22,34 +22,147 @@ local plugin_checker =
require("apisix.plugin").plugin_checker
local str_lower = string.lower
local error = error
local ipairs = ipairs
-
+local sub_str = string.sub
+local table = require("apisix.core.table")
+local json = require("apisix.core.json")
local _M = {version = 0.3}
+local function short_key(self, str)
+ return sub_str(str, #self.key + 2)
+end
-local function filter(route)
+local function filter(route, pre_route_obj, size)
route.orig_modifiedIndex = route.modifiedIndex
- route.update_count = 0
+ route.update_count = 0
route.has_domain = false
- if not route.value then
+ if route.value then
+ if route.value.host then
+ route.value.host = str_lower(route.value.host)
+ elseif route.value.hosts then
+ for i, v in ipairs(route.value.hosts) do
+ route.value.hosts[i] = str_lower(v)
+ end
+ end
+
+ apisix_upstream.filter_upstream(route.value.upstream, route)
+ end
+
+ core.log.info("filter route: ", core.json.delay_encode(route, true))
+
+ --load_full_data()'s filter() goes here. create radixtree while etcd
compacts
+
+ if size then
+ if size == #pre_route_obj.values then
Review Comment:
Reloading data does not necessarily mean that the quantity will be the same,
the data may change.
--
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]