mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2026-07-17 02:04:40 +00:00
The Service analyzer dereferenced EndpointAddress.TargetRef while building the not-ready pod list, but TargetRef is optional and can be nil for addresses not backed by a Pod (bare-IP or manually created Endpoints). A single such address panicked the whole analyze run with a nil pointer dereference. Only append the pod label when TargetRef is set; the address is still counted so the failure message is unchanged. Adds a regression test covering a not-ready address with no TargetRef. Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com> Co-authored-by: Alex Jones <1235925+AlexsJones@users.noreply.github.com>