Skip to content

Commit

Permalink
Merge branch 'task_topology_volcano' into 'master'
Browse files Browse the repository at this point in the history
[Issue volcano-sh#67] move OnJobAdd up for task-topology

related pull request: http://code-cbu.huawei.com/CBU-PaaS/Community/volcano/apollo/merge_requests/4

Issues info:
Issue ID: 67
Title: move OnJobAdd up for task-topology
Issue url: CBU-PaaS/Community/volcano/volcano#67


See merge request CBU-PaaS/Community/volcano/volcano!116
  • Loading branch information
mada 00483107 committed Apr 29, 2019
2 parents 50bcac3 + 564cfc4 commit a65ca81
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pkg/controllers/job/job_controller_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ func (cc *Controller) createJob(jobInfo *apis.JobInfo, nextState state.UpdateSta
job := jobInfo.Job
glog.Infof("Current Version is: %d of job: %s/%s", job.Status.Version, job.Namespace, job.Name)

if err := cc.createPodGroupIfNotExist(job); err != nil {
if err := cc.pluginOnJobAdd(job); err != nil {
cc.recorder.Event(job, v1.EventTypeWarning, string(vkbatchv1.PluginError),
fmt.Sprintf("Execute plugin when job add failed, err: %v", err))
return err
}

if err := cc.createJobIOIfNotExist(job); err != nil {
if err := cc.createPodGroupIfNotExist(job); err != nil {
return err
}

if err := cc.pluginOnJobAdd(job); err != nil {
cc.recorder.Event(job, v1.EventTypeWarning, string(vkbatchv1.PluginError),
fmt.Sprintf("Execute plugin when job add failed, err: %v", err))
if err := cc.createJobIOIfNotExist(job); err != nil {
return err
}

Expand Down Expand Up @@ -423,8 +423,9 @@ func (cc *Controller) createPodGroupIfNotExist(job *vkv1.Job) error {
}
pg := &kbv1.PodGroup{
ObjectMeta: metav1.ObjectMeta{
Namespace: job.Namespace,
Name: job.Name,
Namespace: job.Namespace,
Name: job.Name,
Annotations: job.Annotations,
OwnerReferences: []metav1.OwnerReference{
*metav1.NewControllerRef(job, helpers.JobKind),
},
Expand Down

0 comments on commit a65ca81

Please sign in to comment.