(pod coreV1.Pod)
| 80 | } |
| 81 | |
| 82 | func TransformPodListItem(pod coreV1.Pod) PodList { |
| 83 | status, _ := GetPodStatusReason(&pod) |
| 84 | return PodList{ |
| 85 | UID: pod.GetUID(), |
| 86 | Namespace: pod.GetNamespace(), |
| 87 | Name: pod.GetName(), |
| 88 | Node: pod.Spec.NodeName, |
| 89 | Ready: getPodReadyStatus(pod), |
| 90 | Status: status, |
| 91 | Restarts: fmt.Sprintf("%d", restartCount(pod)), |
| 92 | LastRestartAt: lastRestartTime(pod), |
| 93 | Qos: string(pod.Status.QOSClass), |
| 94 | PodIP: pod.Status.PodIP, |
| 95 | Age: pod.CreationTimestamp.Time, |
| 96 | HasUpdated: hasUpdated(pod), |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func lastRestartTime(pod coreV1.Pod) string { |
| 101 | for _, containerStatus := range pod.Status.ContainerStatuses { |
no test coverage detected