Skip to content

Commit 8c454c3

Browse files
committed
added check for successfull and failed pods in job_controller_actions
Signed-off-by: Kevin Jacob <[email protected]>
1 parent e7bf847 commit 8c454c3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pkg/controllers/job/job_controller_actions.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,22 @@ func (cc *jobcontroller) killPods(jobInfo *apis.JobInfo, podRetainPhase state.Ph
163163
classifyAndAddUpPodBaseOnPhase(pod, &pending, &running, &succeeded, &failed, &unknown)
164164
calcPodStatus(pod, taskStatusCount)
165165
}
166+
// update the status for the pods which are not going to be killed
167+
for _, pods := range jobInfo.Pods {
168+
for _, pod := range pods {
169+
_, isPodGoingToBeKilled := podsToKill[pod.Name]
170+
if !isPodGoingToBeKilled {
171+
if pod.DeletionTimestamp != nil {
172+
klog.Infof("Pod <%s/%s> is terminating", pod.Namespace, pod.Name)
173+
terminating++
174+
continue
175+
}
176+
177+
classifyAndAddUpPodBaseOnPhase(pod, &pending, &running, &succeeded, &failed, &unknown)
178+
calcPodStatus(pod, taskStatusCount)
179+
}
180+
}
181+
}
166182

167183
if len(errs) != 0 {
168184
klog.Errorf("failed to kill pods for job %s/%s, with err %+v", job.Namespace, job.Name, errs)

0 commit comments

Comments
 (0)