Skip to content

Commit

Permalink
Merge pull request #2351 from hwdef/fix-task-dependsOn
Browse files Browse the repository at this point in the history
fix bug in task dependsOn
  • Loading branch information
volcano-sh-bot authored Jul 21, 2022
2 parents 5f0a540 + cd18865 commit 8b8951f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/controllers/job/job_controller_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,15 @@ func (cc *jobcontroller) isDependsOnPodsReady(task string, job *batch.Job) bool
for _, podName := range dependsOnPods {
pod, err := cc.podLister.Pods(job.Namespace).Get(podName)
if err != nil {
// If pod is not found. There are 2 possibilities.
// 1. vcjob has been deleted. This function should return true.
// 2. pod is not created. This function should return false, continue waiting.
if apierrors.IsNotFound(err) {
_, errGetJob := cc.jobLister.Jobs(job.Namespace).Get(job.Name)
if errGetJob != nil {
return apierrors.IsNotFound(errGetJob)
}
}
klog.Errorf("Failed to get pod %v/%v %v", job.Namespace, podName, err)
continue
}
Expand Down

0 comments on commit 8b8951f

Please sign in to comment.