AlinsRan commented on code in PR #11654: URL: https://github.com/apache/apisix/pull/11654#discussion_r2272213874
########## 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: Why add this extra judgment? Is there any problem with the previous handling of `endpointslices or {}`? -- 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: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org