Skip to content

Commit

Permalink
Merge pull request #3442 from bibibox/fix-nil-pointer
Browse files Browse the repository at this point in the history
fix nil pointer panic when evict
  • Loading branch information
volcano-sh-bot committed Apr 27, 2024
2 parents 44369cd + 494bdb4 commit 3c21d67
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/scheduler/cache/cache.go
Expand Up @@ -878,7 +878,13 @@ func (sc *SchedulerCache) Evict(taskInfo *schedulingapi.TaskInfo, reason string)
}()

podgroup := &vcv1beta1.PodGroup{}
if err := schedulingscheme.Scheme.Convert(&job.PodGroup.PodGroup, podgroup, nil); err != nil {
if job.PodGroup != nil {
err = schedulingscheme.Scheme.Convert(&job.PodGroup.PodGroup, podgroup, nil)
} else {
err = fmt.Errorf("the PodGroup of Job <%s/%s> is nil", job.Namespace, job.Name)
}

if err != nil {
klog.Errorf("Error while converting PodGroup to v1alpha1.PodGroup with error: %v", err)
return err
}
Expand Down

0 comments on commit 3c21d67

Please sign in to comment.