Baoyuantop commented on code in PR #11654:
URL: https://github.com/apache/apisix/pull/11654#discussion_r2275570708
##########
apisix/discovery/kubernetes/init.lua:
##########
@@ -60,32 +61,34 @@ local function on_endpoint_slices_modified(handle, endpoint)
core.table.clear(endpoint_buffer)
local endpointslices = endpoint.endpoints
- for _, endpointslice in ipairs(endpointslices or {}) do
- if endpointslice.addresses then
- local addresses = endpointslices.addresses
- for _, port in ipairs(endpoint.ports or {}) do
- local port_name
- if port.name then
- port_name = port.name
- elseif port.targetPort then
- port_name = tostring(port.targetPort)
- else
- port_name = tostring(port.port)
- end
-
- if endpointslice.conditions and endpointslice.condition.ready
then
- local nodes = endpoint_buffer[port_name]
- if nodes == nil then
- nodes = core.table.new(0, #endpointslices * #addresses)
- endpoint_buffer[port_name] = nodes
+ if type(endpointslices) == "table" then
Review Comment:
Hi @slayer321, can you explain this?
--
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]