type JobState … // WaitForJobPodsRunning 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 WaitForJobPodsRunning(ctx context.Context, c clientset.Interface, ns, jobName string, expectedCount int32) error { … } // WaitForJobPodsRunningWithTimeout 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. same as WaitForJobPodsRunning but with an additional timeout parameter func WaitForJobPodsRunningWithTimeout(ctx context.Context, c clientset.Interface, ns, jobName string, expectedCount int32, timeout time.Duration) error { … } // WaitForJobPodsSucceeded wait for all pods for the Job named JobName in namespace ns to become Succeeded. func WaitForJobPodsSucceeded(ctx context.Context, c clientset.Interface, ns, jobName string, expectedCount int32) error { … } // waitForJobPodsInPhase wait for all pods for the Job named JobName in namespace ns to be in a given phase. func waitForJobPodsInPhase(ctx context.Context, c clientset.Interface, ns, jobName string, expectedCount int32, phase v1.PodPhase, timeout time.Duration) error { … } // WaitForJobComplete uses c to wait for completions to complete for the Job jobName in namespace ns. // This function checks if the number of succeeded Job Pods reached expected completions and // the Job has a "Complete" condition with the expected reason. // The pointer "reason" argument allows us to skip "Complete" condition reason verifications. // The conformance test cases have the different expected "Complete" condition reason ("CompletionsReached" vs "") // between conformance CI jobs and e2e CI jobs since the e2e conformance test cases are performed in // both conformance CI jobs with GA-only features and e2e CI jobs with all default-enabled features. // So, we need to skip "Complete" condition reason verifications in the e2e conformance test cases. func WaitForJobComplete(ctx context.Context, c clientset.Interface, ns, jobName string, reason *string, completions int32) error { … } // WaitForJobReady waits for particular value of the Job .status.ready field func WaitForJobReady(ctx context.Context, c clientset.Interface, ns, jobName string, ready *int32) error { … } // WaitForJobSuspend uses c to wait for suspend condition for the Job jobName in namespace ns. func WaitForJobSuspend(ctx context.Context, c clientset.Interface, ns, jobName string) error { … } // WaitForJobFailed uses c to wait for the Job jobName in namespace ns to fail func WaitForJobFailed(ctx context.Context, c clientset.Interface, ns, jobName string) error { … } // WaitForJobCondition waits for the specified Job to have the expected condition with the specific reason. // When the nil reason is passed, the "reason" string in the condition is // not checked. func WaitForJobCondition(ctx context.Context, c clientset.Interface, ns, jobName string, cType batchv1.JobConditionType, reason *string) error { … } // WaitForJobFinish uses c to wait for the Job jobName in namespace ns to finish (either Failed or Complete). func WaitForJobFinish(ctx context.Context, c clientset.Interface, ns, jobName string) error { … } // WaitForJobFinishWithTimeout uses c to wait for the Job jobName in namespace ns to finish (either Failed or Complete). func WaitForJobFinishWithTimeout(ctx context.Context, c clientset.Interface, ns, jobName string, timeout time.Duration) error { … } func isJobFinished(j *batchv1.Job) bool { … } func isJobFailed(j *batchv1.Job) bool { … } func isJobCompleted(j *batchv1.Job) bool { … } func isConditionTrue(j *batchv1.Job, condition batchv1.JobConditionType) bool { … } // WaitForJobGone uses c to wait for up to timeout for the Job named jobName in namespace ns to be removed. func WaitForJobGone(ctx context.Context, c clientset.Interface, ns, jobName string, timeout time.Duration) error { … } // WaitForAllJobPodsGone waits for all pods for the Job named jobName in namespace ns // to be deleted. func WaitForAllJobPodsGone(ctx context.Context, c clientset.Interface, ns, jobName string) error { … } // WaitForJobState waits for a job to be matched to the given condition. // The condition callback may use gomega.StopTrying to abort early. func WaitForJobState(ctx context.Context, c clientset.Interface, ns, jobName string, timeout time.Duration, state JobState) error { … }