kubernetes/pkg/controller/job/job_controller_test.go

var realClock

var alwaysReady

const fastSyncJobBatchPeriod

const fastJobApiBackoff

const fastRequeue

var testFinishedAt

func newJobWithName(name string, parallelism, completions, backoffLimit int32, completionMode batch.CompletionMode) *batch.Job {}

func newJob(parallelism, completions, backoffLimit int32, completionMode batch.CompletionMode) *batch.Job {}

func newControllerFromClient(ctx context.Context, t *testing.T, kubeClient clientset.Interface, resyncPeriod controller.ResyncPeriodFunc) (*Controller, informers.SharedInformerFactory) {}

func newControllerFromClientWithClock(ctx context.Context, t *testing.T, kubeClient clientset.Interface, resyncPeriod controller.ResyncPeriodFunc, clock clock.WithTicker) (*Controller, informers.SharedInformerFactory) {}

func newPod(name string, job *batch.Job) *v1.Pod {}

// create count pods with the given phase for the given job
func newPodList(count int, status v1.PodPhase, job *batch.Job) []*v1.Pod {}

func setPodsStatuses(podIndexer cache.Indexer, job *batch.Job, pendingPods, activePods, succeededPods, failedPods, terminatingPods, readyPods int) {}

func setPodsStatusesWithIndexes(podIndexer cache.Indexer, job *batch.Job, status []indexPhase) {}

type jobInitialStatus

func TestControllerSyncJob(t *testing.T) {}

func checkIndexedJobPods(t *testing.T, control *controller.FakePodControl, wantIndexes sets.Set[int], jobName string, podIndexLabelDisabled bool) {}

func TestGetNewFinshedPods(t *testing.T) {}

func TestTrackJobStatusAndRemoveFinalizers(t *testing.T) {}

// TestSyncJobPastDeadline verifies tracking of active deadline in a single syncJob call.
func TestSyncJobPastDeadline(t *testing.T) {}

func getCondition(job *batch.Job, condition batch.JobConditionType, status v1.ConditionStatus, reason string) bool {}

// TestPastDeadlineJobFinished ensures that a Job is correctly tracked until
// reaching the active deadline, at which point it is marked as Failed.
func TestPastDeadlineJobFinished(t *testing.T) {}

func TestSingleJobFailedCondition(t *testing.T) {}

func TestSyncJobComplete(t *testing.T) {}

func TestSyncJobDeleted(t *testing.T) {}

func TestSyncJobWhenManagedBy(t *testing.T) {}

func TestSyncJobWithJobPodFailurePolicy(t *testing.T) {}

func TestSyncJobWithJobSuccessPolicy(t *testing.T) {}

func TestSyncJobWithJobBackoffLimitPerIndex(t *testing.T) {}

func TestSyncJobUpdateRequeue(t *testing.T) {}

func TestUpdateJobRequeue(t *testing.T) {}

func TestGetPodCreationInfoForIndependentIndexes(t *testing.T) {}

func TestJobPodLookup(t *testing.T) {}

func TestGetPodsForJob(t *testing.T) {}

func TestAddPod(t *testing.T) {}

func TestAddPodOrphan(t *testing.T) {}

func TestUpdatePod(t *testing.T) {}

func TestUpdatePodOrphanWithNewLabels(t *testing.T) {}

func TestUpdatePodChangeControllerRef(t *testing.T) {}

func TestUpdatePodRelease(t *testing.T) {}

func TestDeletePod(t *testing.T) {}

func TestDeletePodOrphan(t *testing.T) {}

type FakeJobExpectations

func (fe FakeJobExpectations) SatisfiedExpectations(logger klog.Logger, controllerKey string) bool {}

// TestSyncJobExpectations tests that a pod cannot sneak in between counting active pods
// and checking expectations.
func TestSyncJobExpectations(t *testing.T) {}

func TestWatchJobs(t *testing.T) {}

func TestWatchPods(t *testing.T) {}

func TestWatchOrphanPods(t *testing.T) {}

func TestSyncOrphanPod(t *testing.T) {}

func bumpResourceVersion(obj metav1.Object) {}

func TestJobApiBackoffReset(t *testing.T) {}

var _

type fakeRateLimitingQueue

func (f *fakeRateLimitingQueue) AddRateLimited(item string) {}

func (f *fakeRateLimitingQueue) Forget(item string) {}

func (f *fakeRateLimitingQueue) NumRequeues(item string) int {}

func (f *fakeRateLimitingQueue) AddAfter(item string, duration time.Duration) {}

func TestJobBackoff(t *testing.T) {}

func TestJobBackoffForOnFailure(t *testing.T) {}

func TestJobBackoffOnRestartPolicyNever(t *testing.T) {}

func TestEnsureJobConditions(t *testing.T) {}

func TestFinalizersRemovedExpectations(t *testing.T) {}

func TestFinalizerCleanup(t *testing.T) {}

func checkJobCompletionLabel(t *testing.T, p *v1.PodTemplateSpec) {}

func checkJobCompletionEnvVariable(t *testing.T, spec *v1.PodSpec, podIndexLabelDisabled bool) {}

func podReplacementPolicy(m batch.PodReplacementPolicy) *batch.PodReplacementPolicy {}

func verifyEmptyQueueAndAwaitForQueueLen(ctx context.Context, t *testing.T, jm *Controller, wantQueueLen int) {}

func awaitForQueueLen(ctx context.Context, t *testing.T, jm *Controller, wantQueueLen int) {}

func verifyEmptyQueue(t *testing.T, jm *Controller) {}

type podBuilder

func buildPod() podBuilder {}

func getConditionsByType(list []batch.JobCondition, cType batch.JobConditionType) []*batch.JobCondition {}

func (pb podBuilder) name(n string) podBuilder {}

func (pb podBuilder) ns(n string) podBuilder {}

func (pb podBuilder) uid(u string) podBuilder {}

func (pb podBuilder) labels(labels map[string]string) podBuilder {}

func (pb podBuilder) job(j *batch.Job) podBuilder {}

func (pb podBuilder) owner(ownerRef metav1.OwnerReference) podBuilder {}

func (pb podBuilder) clearOwner() podBuilder {}

func (pb podBuilder) clearLabels() podBuilder {}

func (pb podBuilder) index(ix string) podBuilder {}

func (pb podBuilder) indexFailureCount(count string) podBuilder {}

func (pb podBuilder) indexIgnoredFailureCount(count string) podBuilder {}

func (pb podBuilder) annotation(key, value string) podBuilder {}

func (pb podBuilder) status(s v1.PodStatus) podBuilder {}

func (pb podBuilder) phase(p v1.PodPhase) podBuilder {}

func (pb podBuilder) trackingFinalizer() podBuilder {}

func (pb podBuilder) deletionTimestamp() podBuilder {}

func (pb podBuilder) customDeletionTimestamp(t time.Time) podBuilder {}

func setDurationDuringTest(val *time.Duration, newVal time.Duration) func() {}