Skip to content

Commit

Permalink
Merge branch 'fixrunningnum' into 'master'
Browse files Browse the repository at this point in the history
if running pod greater or equal to MinAvailable then set job phase running





See merge request CBU-PaaS/Community/volcano/volcano!34
  • Loading branch information
mada 00483107 committed Feb 20, 2019
2 parents e712460 + 98e87fa commit 8e90652
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/batch/v1alpha1/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const (
Running JobPhase = "Running"
// Restarting is the phase that the Job is restarted, waiting for pod releasing and recreating
Restarting JobPhase = "Restarting"
// Completed is the phase that all tasks of Job are completed successfully
// Completed is the phase that all tasks of Job are completed
Completed JobPhase = "Completed"
// Terminating is the phase that the Job is terminated, waiting for releasing pods
Terminating JobPhase = "Terminating"
Expand Down
3 changes: 1 addition & 2 deletions pkg/controllers/job/state/pending.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ func (ps *pendingState) Execute(action vkv1.Action) error {
})
default:
return SyncJob(ps.job, func(status vkv1.JobStatus) vkv1.JobState {
total := totalTasks(ps.job.Job)
phase := vkv1.Pending

if total == status.Running {
if ps.job.Job.Spec.MinAvailable <= status.Running {
phase = vkv1.Running
}
return vkv1.JobState{
Expand Down

0 comments on commit 8e90652

Please sign in to comment.