code: func getJobFromTemplate(sj *batchv1beta1.CronJob, scheduledTime time.Time) (*batchv1.Job, error) {
  	labels := copyLabels(&sj.Spec.JobTemplate)
  	annotations := copyAnnotations(&sj.Spec.JobTemplate)
  	// We want job names for a given nominal start time to have a deterministic name to avoid the same job being created twice
  	name := fmt.Sprintf("%s-%d", sj.Name, getTimeHash(scheduledTime))
  
  	job := &batchv1.Job{
  		ObjectMeta: metav1.ObjectMeta{
  			Labels:          labels,
  			Annotations:     annotations,
  			Name:            name,
  			OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(sj, controllerKind)},
  		},
  	}
  	if err := legacyscheme.Scheme.Convert(&sj.Spec.JobTemplate.Spec, &job.Spec, nil); err != nil {
  		return nil, fmt.Errorf("unable to convert job template: %v", err)
  	}
  	return job, nil
  }
docs: // getJobFromTemplate makes a Job from a CronJob