Skip to content

Commit af9059f

Browse files
committed
Update pod status logic
1 parent d9ced09 commit af9059f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pkg/lib/k8s/pod.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ func GetPodStatus(pod *kcore.Pod) PodStatus {
172172
numFailed := 0
173173
numKilled := 0
174174
for _, containerStatus := range pod.Status.ContainerStatuses {
175-
if containerStatus.State.Waiting != nil {
176-
numWaiting++
177-
} else if containerStatus.State.Running != nil {
175+
if containerStatus.State.Running != nil {
178176
if containerStatus.Ready {
179177
numRunning++
180178
} else {
@@ -199,7 +197,8 @@ func GetPodStatus(pod *kcore.Pod) PodStatus {
199197
numFailed++
200198
}
201199
} else {
202-
return PodStatusUnknown
200+
// either containerStatus.State.Waiting != nil or all containerStatus.States are nil (which implies waiting)
201+
numWaiting++
203202
}
204203
}
205204
if numKilled > 0 {

0 commit comments

Comments
 (0)