Skip to content

Commit

Permalink
Merge branch 'bugfix_create_pod_looping' into 'master'
Browse files Browse the repository at this point in the history
[Issue volcano-sh#51] [BUG2019040200210] DeletedFinalStateUnknown should be handled correctly

DeletedFinalStateUnknown should be handled correctly

Issues info:
Issue ID: 51
Title: [BUG2019040200210] job已经被删除的情况下,pod反复重新拉起被kill的操作
Issue url: CBU-PaaS/Community/volcano/volcano#51


See merge request CBU-PaaS/Community/volcano/volcano!84
  • Loading branch information
mada 00483107 committed Apr 10, 2019
2 parents 079f9d9 + fa4d7dc commit 9b4bc0c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions pkg/controllers/job/job_controller_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,19 @@ func (cc *Controller) updateJob(oldObj, newObj interface{}) {
}

func (cc *Controller) deleteJob(obj interface{}) {
job, ok := obj.(*vkbatchv1.Job)
if !ok {
glog.Errorf("obj is not Job")
var job *vkbatchv1.Job
switch t := obj.(type) {
case *vkbatchv1.Job:
job = t
case cache.DeletedFinalStateUnknown:
var ok bool
job, ok = t.Obj.(*vkbatchv1.Job)
if !ok {
glog.Errorf("Cannot convert to *vkbatchv1.Job in DeletedFinalState: %v", t.Obj)
return
}
default:
glog.Errorf("Cannot convert to *vkbatchv1.Job: %v", t)
return
}

Expand Down

0 comments on commit 9b4bc0c

Please sign in to comment.