示例#1
0
文件: job.go 项目: JingGe/kubernetes
// 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
	})
}
示例#2
0
文件: job.go 项目: JingGe/kubernetes
func deleteJob(c *client.Client, ns, name string) error {
	return c.Experimental().Jobs(ns).Delete(name, api.NewDeleteOptions(0))
}
示例#3
0
文件: job.go 项目: JingGe/kubernetes
func createJob(c *client.Client, ns string, job *experimental.Job) (*experimental.Job, error) {
	return c.Experimental().Jobs(ns).Create(job)
}