Skip to content

Commit 05b178e

Browse files
committed
Update pod status logic
(cherry picked from commit af9059f)
1 parent 3039cf5 commit 05b178e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pkg/lib/k8s/pod.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ func GetPodStatus(pod *kcore.Pod) PodStatus {
170170
numFailed := 0
171171
numKilled := 0
172172
for _, containerStatus := range pod.Status.ContainerStatuses {
173-
if containerStatus.State.Waiting != nil {
174-
numWaiting++
175-
} else if containerStatus.State.Running != nil {
173+
if containerStatus.State.Running != nil {
176174
if containerStatus.Ready {
177175
numRunning++
178176
} else {
@@ -197,7 +195,8 @@ func GetPodStatus(pod *kcore.Pod) PodStatus {
197195
numFailed++
198196
}
199197
} else {
200-
return PodStatusUnknown
198+
// either containerStatus.State.Waiting != nil or all containerStatus.States are nil (which implies waiting)
199+
numWaiting++
201200
}
202201
}
203202
if numKilled > 0 {

0 commit comments

Comments
 (0)