Skip to content

Commit

Permalink
change wait dependson job log level to error
Browse files Browse the repository at this point in the history
Signed-off-by: Ren <rwl1212@126.com>
  • Loading branch information
Along-Ren committed Jun 25, 2023
1 parent 7a9f1ba commit 6d0ab3b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
3 changes: 2 additions & 1 deletion cmd/controller-manager/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ package options

import (
"fmt"
"github.com/spf13/pflag"
"os"

"github.com/spf13/pflag"

"volcano.sh/volcano/pkg/kube"
)

Expand Down
17 changes: 8 additions & 9 deletions cmd/controller-manager/app/options/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
18 changes: 9 additions & 9 deletions pkg/controllers/job/job_controller_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.V(3).Infof("Job %s/%s depends on task not ready", job.Name, job.Namespace)
// release wait group
for _, pod := range podToCreateEachTask {
go func(pod *v1.Pod) {
Expand Down Expand Up @@ -491,22 +491,22 @@ 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
}
}
// all not ready to skip create task, return false
return false
} else {
for _, dependsOnTask := range dependsOn.Name {
// any not ready to skip
if !cc.isDependsOnPodsReady(dependsOnTask, job) {
return false
}
return true
}
for _, dependsOnTask := range dependsOn.Name {
// any not ready to skip create task, return false
if !cc.isDependsOnPodsReady(dependsOnTask, job) {
return false
}
}
// all ready to create task, return true
return true
}

Expand Down
1 change: 1 addition & 0 deletions pkg/controllers/job/job_controller_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package job

import (
"fmt"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down

0 comments on commit 6d0ab3b

Please sign in to comment.