Documentation ¶
Index ¶
- Constants
- func CreateJob(c clientset.Interface, ns string, job *batchv1.Job) (*batchv1.Job, error)
- func GetJob(c clientset.Interface, ns, name string) (*batchv1.Job, error)
- func GetJobPods(c clientset.Interface, ns, jobName string) (*v1.PodList, error)
- func NewTestJob(behavior, name string, rPol v1.RestartPolicy, parallelism, completions int32, ...) *batchv1.Job
- func NewTestJobOnNode(behavior, name string, rPol v1.RestartPolicy, parallelism, completions int32, ...) *batchv1.Job
- func UpdateJob(c clientset.Interface, ns string, job *batchv1.Job) (*batchv1.Job, error)
- func WaitForAllJobPodsGone(c clientset.Interface, ns, jobName string) error
- func WaitForAllJobPodsRunning(c clientset.Interface, ns, jobName string, parallelism int32) error
- func WaitForJobComplete(c clientset.Interface, ns, jobName string, completions int32) error
- func WaitForJobFinish(c clientset.Interface, ns, jobName string) error
- func WaitForJobGone(c clientset.Interface, ns, jobName string, timeout time.Duration) error
Constants ¶
const ( // JobTimeout is how long to wait for a job to finish. JobTimeout = 15 * time.Minute // JobSelectorKey is a job selector name JobSelectorKey = "job" )
Variables ¶
This section is empty.
Functions ¶
func CreateJob ¶
CreateJob uses c to create job in namespace ns. If the returned error is nil, the returned Job is valid and has been created.
func GetJob ¶
GetJob uses c to get the Job in namespace ns named name. If the returned error is nil, the returned Job is valid.
func GetJobPods ¶
GetJobPods returns a list of Pods belonging to a Job.
func NewTestJob ¶
func NewTestJob(behavior, name string, rPol v1.RestartPolicy, parallelism, completions int32, activeDeadlineSeconds *int64, backoffLimit int32) *batchv1.Job
NewTestJob returns a Job which does one of several testing behaviors. notTerminate starts a Job that will run effectively forever. fail starts a Job that will fail immediately. succeed starts a Job that will succeed immediately. randomlySucceedOrFail starts a Job that will succeed or fail randomly. failOnce fails the Job the first time it is run and succeeds subsequently. name is the Name of the Job. RestartPolicy indicates the restart policy of the containers in which the Pod is running. Parallelism is the Job's parallelism, and completions is the Job's required number of completions.
func NewTestJobOnNode ¶ added in v1.18.0
func NewTestJobOnNode(behavior, name string, rPol v1.RestartPolicy, parallelism, completions int32, activeDeadlineSeconds *int64, backoffLimit int32, nodeName string) *batchv1.Job
NewTestJobOnNode is similar to NewTestJob but supports specifying a Node on which the Job's Pods will run. Empty nodeName means no node selection constraints.
func UpdateJob ¶
CreateJob uses c to update a job in namespace ns. If the returned error is nil, the returned Job is valid and has been updated.
func WaitForAllJobPodsGone ¶
WaitForAllJobPodsGone waits for all pods for the Job named jobName in namespace ns to be deleted.
func WaitForAllJobPodsRunning ¶
WaitForAllJobPodsRunning wait for all pods for the Job named JobName in namespace ns to become Running. Only use when pods will run for a long time, or it will be racy.
func WaitForJobComplete ¶
WaitForJobComplete uses c to wait for completions to complete for the Job jobName in namespace ns.
func WaitForJobFinish ¶
WaitForJobFinish uses c to wait for the Job jobName in namespace ns to finish (either Failed or Complete).
Types ¶
This section is empty.