code: func (c *Client) waitForJob(e watch.Event, name string) (bool, error) {
  	job := &batch.Job{}
  	err := legacyscheme.Scheme.Convert(e.Object, job, nil)
  	if err != nil {
  		return true, err
  	}
  
  	for _, c := range job.Status.Conditions {
  		if c.Type == batch.JobComplete && c.Status == v1.ConditionTrue {
  			return true, nil
  		} else if c.Type == batch.JobFailed && c.Status == v1.ConditionTrue {
  			return true, fmt.Errorf("Job failed: %s", c.Reason)
  		}
  	}
  
  	c.Log("%s: Jobs active: %d, jobs failed: %d, jobs succeeded: %d", name, job.Status.Active, job.Status.Failed, job.Status.Succeeded)
  	return false, nil
  }
docs: // waitForJob is a helper that waits for a job to complete.
  //
  // This operates on an event returned from a watcher.