fix: remap Service egress ports to targetPort for NetworkPolicy generation (#943) (#944)
* fix: remap Service egress ports to enforcement ports for NetworkPolicy (#943) eBPF observes the Service port before kube-proxy DNAT, but CNIs enforce on the pod targetPort. Resolve numeric, omitted, and named targetPorts (via EndpointSlice with Endpoints fallback) into NetworkNeighbor.Ports when serializing egress neighbors so generated policies open the port the CNI actually matches. Companion helm-charts PR required for EndpointSlice RBAC in production. Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com> * fix: account for all resolved Service ports and guard nil Endpoints Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com> * fix: restore closing brace in Service port regression test Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com> --------- Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com> Signed-off-by: Gauarv Chaudhary <137998824+ANAMASGARD@users.noreply.github.com>
G
Gauarv Chaudhary committed
a327e76ac61a9699a5452b70a25e46758cae7cf0
Parent: 1c450e5
Committed by GitHub <noreply@github.com>
on 9/8/2026, 5:24:35 AM