fn handle_endpoint_removal()

in nfm-controller/src/kubernetes/kubernetes_metadata_collector.rs [244:258]


    fn handle_endpoint_removal(
        slice: EndpointSlice,
        mut pod_info: MutexGuard<'_, HashMap<IpAddr, HashMap<i32, PodInfo>>>,
    ) {
        let ports: Vec<i32> = Self::get_tcp_ports_from_endpoint_slice(&slice);
        for endpoint in &slice.endpoints {
            for address in &endpoint.addresses {
                let pod_ip = match IpAddr::from_str(address) {
                    Ok(ip) => ip,
                    Err(_) => continue,
                };
                Self::purge_pod_ip_ports_from_pod_info(&mut pod_info, &pod_ip, &ports);
            }
        }
    }