mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2026-07-17 18:30:21 +00:00
A pod with non-empty .spec.schedulingGates stays in the Pending phase with a PodScheduled condition of Status=False, Reason=SchedulingGated. The pod analyzer only matched the Unschedulable reason, so a gated pod fell through every branch and was reported as having no problems. Add a sibling check on the PodScheduled condition for the SchedulingGated reason. Gated pods commonly carry an empty condition message, so emit a default message naming the pod when none is present and surface the condition message otherwise, mirroring how the Unschedulable branch reports. This is the residual half of #1474; the suspended Job/CronJob half is already handled in job.go and cronjob.go. Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>