code: func pastBackoffLimitOnFailure(job *batch.Job, pods []*v1.Pod) bool {
  	if job.Spec.Template.Spec.RestartPolicy != v1.RestartPolicyOnFailure {
  		return false
  	}
  	result := int32(0)
  	for i := range pods {
  		po := pods[i]
  		if po.Status.Phase != v1.PodRunning {
  			continue
  		}
  		for j := range po.Status.InitContainerStatuses {
  			stat := po.Status.InitContainerStatuses[j]
  			result += stat.RestartCount
  		}
  		for j := range po.Status.ContainerStatuses {
  			stat := po.Status.ContainerStatuses[j]
  			result += stat.RestartCount
  		}
  	}
  	if *job.Spec.BackoffLimit == 0 {
  		return result > 0
  	}
  	return result >= *job.Spec.BackoffLimit
  }
docs: // pastBackoffLimitOnFailure checks if container restartCounts sum exceeds BackoffLimit
  // this method applies only to pods with restartPolicy == OnFailure