Example #1
0
// Wait for job to reach completions.
func waitForJobFinish(c *client.Client, ns, jobName string, completions int) error {
	return wait.Poll(poll, jobTimeout, func() (bool, error) {
		curr, err := c.Experimental().Jobs(ns).Get(jobName)
		if err != nil {
			return false, err
		}
		return curr.Status.Successful == completions, nil
	})
}
Example #2
0
func deleteJob(c *client.Client, ns, name string) error {
	return c.Experimental().Jobs(ns).Delete(name, api.NewDeleteOptions(0))
}
Example #3
0
func createJob(c *client.Client, ns string, job *experimental.Job) (*experimental.Job, error) {
	return c.Experimental().Jobs(ns).Create(job)
}