diff --git a/cmd/controller-manager/app/options/options_test.go b/cmd/controller-manager/app/options/options_test.go index e3a7f56b82b..e728ba89d59 100644 --- a/cmd/controller-manager/app/options/options_test.go +++ b/cmd/controller-manager/app/options/options_test.go @@ -46,15 +46,14 @@ func TestAddFlags(t *testing.T) { QPS: defaultQPS, Burst: 200, }, - PrintVersion: false, - WorkerThreads: defaultWorkers, - SchedulerNames: []string{"volcano", "volcano2"}, - MaxRequeueNum: defaultMaxRequeueNum, - HealthzBindAddress: ":11251", - DetectionPeriodOfDependsOntask: defaultDetectionPeriodOfDependsOntask, - InheritOwnerAnnotations: true, - EnableLeaderElection: true, - LockObjectNamespace: defaultLockObjectNamespace, + PrintVersion: false, + WorkerThreads: defaultWorkers, + SchedulerNames: []string{"volcano", "volcano2"}, + MaxRequeueNum: defaultMaxRequeueNum, + HealthzBindAddress: ":11251", + InheritOwnerAnnotations: true, + EnableLeaderElection: true, + LockObjectNamespace: defaultLockObjectNamespace, } if !reflect.DeepEqual(expected, s) { diff --git a/pkg/controllers/job/job_controller_actions.go b/pkg/controllers/job/job_controller_actions.go index f75a0ede70e..171d7d64db9 100644 --- a/pkg/controllers/job/job_controller_actions.go +++ b/pkg/controllers/job/job_controller_actions.go @@ -378,7 +378,7 @@ func (cc *jobcontroller) syncJob(jobInfo *apis.JobInfo, updateStatus state.Updat taskIndex := jobhelpers.GetTasklndexUnderJob(taskName, job) if job.Spec.Tasks[taskIndex].DependsOn != nil { if !cc.waitDependsOnTaskMeetCondition(taskName, taskIndex, podToCreateEachTask, job) { - klog.V(4).Infof("Job %s/%s depends on task not ready", job.Name, job.Namespace) + klog.Errorf("Job %s/%s depends on task not ready", job.Name, job.Namespace) // release wait group for _, pod := range podToCreateEachTask { go func(pod *v1.Pod) { @@ -491,21 +491,23 @@ func (cc *jobcontroller) waitDependsOnTaskMeetCondition(taskName string, taskInd } dependsOn := *job.Spec.Tasks[taskIndex].DependsOn if len(dependsOn.Name) > 1 && dependsOn.Iteration == batch.IterationAny { - // any ready to create task + // any ready to create task, return true for _, task := range dependsOn.Name { if cc.isDependsOnPodsReady(task, job) { return true } } + // any not ready to skip create task, return false return false } else { for _, dependsOnTask := range dependsOn.Name { - // any not ready to skip + // any not ready to skip create task, return false if !cc.isDependsOnPodsReady(dependsOnTask, job) { return false } - return true } + // all ready to create task, return true + return true } return true }