diff --git a/pkg/library/status/check.go b/pkg/library/status/check.go index 2dad05fd1..8d9e2468d 100644 --- a/pkg/library/status/check.go +++ b/pkg/library/status/check.go @@ -96,6 +96,12 @@ func CheckPodsState(workspaceID string, namespace string, labelSelector k8sclien if msg, err := CheckPodEvents(&pod, workspaceID, ignoredEvents, clusterAPI); err != nil || msg != "" { return msg, err } + if pod.Status.Phase == corev1.PodPending { + if msg := checkPodConditions(&pod); msg != "" { + return msg, nil + } + } + } return "", nil } @@ -164,3 +170,14 @@ func checkIfUnrecoverableEventIgnored(reason string, ignoredEvents []string) (ig } return false } + +func checkPodConditions(pod *corev1.Pod) (msg string) { + if pod.Status.Conditions != nil { + for _, condition := range pod.Status.Conditions { + if condition.Type == corev1.PodScheduled && condition.Status == corev1.ConditionFalse && condition.Reason == corev1.PodReasonUnschedulable { + return fmt.Sprintf("Pod is unschedulable: %s", condition.Message) + } + } + } + return "" +}