kubernetes/pkg/kubelet/pod_workers_test.go

type fakePodWorkers

func (f *fakePodWorkers) UpdatePod(options UpdatePodOptions) {}

func (f *fakePodWorkers) SyncKnownPods(desiredPods []*v1.Pod) map[types.UID]PodWorkerSync {}

func (f *fakePodWorkers) IsPodKnownTerminated(uid types.UID) bool {}

func (f *fakePodWorkers) CouldHaveRunningContainers(uid types.UID) bool {}

func (f *fakePodWorkers) ShouldPodBeFinished(uid types.UID) bool {}

func (f *fakePodWorkers) IsPodTerminationRequested(uid types.UID) bool {}

func (f *fakePodWorkers) ShouldPodContainersBeTerminating(uid types.UID) bool {}

func (f *fakePodWorkers) ShouldPodRuntimeBeRemoved(uid types.UID) bool {}

func (f *fakePodWorkers) setPodRuntimeBeRemoved(uid types.UID) {}

func (f *fakePodWorkers) ShouldPodContentBeRemoved(uid types.UID) bool {}

func (f *fakePodWorkers) IsPodForMirrorPodTerminatingByFullName(podFullname string) bool {}

type TestingInterface

func newPodWithPhase(uid, name string, phase v1.PodPhase) *v1.Pod {}

func newStaticPod(uid, name string) *v1.Pod {}

func newNamedPod(uid, namespace, name string, isStatic bool) *v1.Pod {}

type syncPodRecord

type FakeQueueItem

type fakeQueue

func (q *fakeQueue) Empty() bool {}

func (q *fakeQueue) Items() []FakeQueueItem {}

func (q *fakeQueue) Set() sets.Set[string] {}

func (q *fakeQueue) Enqueue(uid types.UID, delay time.Duration) {}

func (q *fakeQueue) GetWork() []types.UID {}

type timeIncrementingWorkers

// UpdatePod increments the clock after UpdatePod is called, but before the workers
// are invoked, and then drains all workers before returning. The provided functions
// are invoked while holding the lock to prevent workers from receiving updates.
func (w *timeIncrementingWorkers) UpdatePod(options UpdatePodOptions, afterFns ...func()) {}

// SyncKnownPods increments the clock after SyncKnownPods is called, but before the workers
// are invoked, and then drains all workers before returning.
func (w *timeIncrementingWorkers) SyncKnownPods(desiredPods []*v1.Pod) (knownPods map[types.UID]PodWorkerSync) {}

func (w *timeIncrementingWorkers) PauseWorkers(uids ...types.UID) {}

func (w *timeIncrementingWorkers) ReleaseWorkers(uids ...types.UID) {}

func (w *timeIncrementingWorkers) ReleaseWorkersUnderLock(uids ...types.UID) {}

func (w *timeIncrementingWorkers) waitForPod(uid types.UID) {}

func (w *timeIncrementingWorkers) drainUnpausedWorkers() {}

func (w *timeIncrementingWorkers) tick() {}

// createTimeIncrementingPodWorkers will guarantee that each call to UpdatePod and each worker goroutine invocation advances the clock by one second,
// although multiple workers will advance the clock in an unpredictable order. Use to observe
// successive internal updates to each update pod state when only a single pod is being updated.
func createTimeIncrementingPodWorkers() (*timeIncrementingWorkers, map[types.UID][]syncPodRecord) {}

func createPodWorkers() (*podWorkers, *containertest.FakeRuntime, map[types.UID][]syncPodRecord) {}

func drainWorkers(podWorkers *podWorkers, numPods int) {}

func drainWorkersExcept(podWorkers *podWorkers, uids ...types.UID) {}

func drainAllWorkers(podWorkers *podWorkers) {}

func TestUpdatePodParallel(t *testing.T) {}

func TestUpdatePod(t *testing.T) {}

func TestUpdatePodForRuntimePod(t *testing.T) {}

func TestUpdatePodForTerminatedRuntimePod(t *testing.T) {}

func TestUpdatePodDoesNotForgetSyncPodKill(t *testing.T) {}

func newUIDSet(uids ...types.UID) sets.Set[string] {}

type terminalPhaseSync

func (s *terminalPhaseSync) SyncPod(ctx context.Context, updateType kubetypes.SyncPodType, pod *v1.Pod, mirrorPod *v1.Pod, podStatus *kubecontainer.PodStatus) (bool, error) {}

func (s *terminalPhaseSync) SetTerminal(uid types.UID) {}

func newTerminalPhaseSync(fn syncPodFnType) *terminalPhaseSync {}

func TestTerminalPhaseTransition(t *testing.T) {}

func TestStaticPodExclusion(t *testing.T) {}

type WorkChannelItem

func (item *WorkChannelItem) Handle() {}

func (item *WorkChannelItem) Hold() {}

func (item *WorkChannelItem) Close() {}

// Release blocks until all work is passed on the chain
func (item *WorkChannelItem) Release() {}

type WorkChannel

func (w *WorkChannel) Channel(uid types.UID) *WorkChannelItem {}

func (w *WorkChannel) Intercept(uid types.UID, ch chan struct{}

func TestSyncKnownPods(t *testing.T) {}

func Test_removeTerminatedWorker(t *testing.T) {}

type simpleFakeKubelet

func (kl *simpleFakeKubelet) SyncPod(ctx context.Context, updateType kubetypes.SyncPodType, pod, mirrorPod *v1.Pod, podStatus *kubecontainer.PodStatus) (bool, error) {}

func (kl *simpleFakeKubelet) SyncPodWithWaitGroup(ctx context.Context, updateType kubetypes.SyncPodType, pod, mirrorPod *v1.Pod, podStatus *kubecontainer.PodStatus) (bool, error) {}

func (kl *simpleFakeKubelet) SyncTerminatingPod(ctx context.Context, pod *v1.Pod, podStatus *kubecontainer.PodStatus, gracePeriod *int64, podStatusFn func(*v1.PodStatus)) error {}

func (kl *simpleFakeKubelet) SyncTerminatingRuntimePod(ctx context.Context, runningPod *kubecontainer.Pod) error {}

func (kl *simpleFakeKubelet) SyncTerminatedPod(ctx context.Context, pod *v1.Pod, podStatus *kubecontainer.PodStatus) error {}

// TestFakePodWorkers verifies that the fakePodWorkers behaves the same way as the real podWorkers
// for their invocation of the syncPodFn.
func TestFakePodWorkers(t *testing.T) {}

// TestKillPodNowFunc tests the blocking kill pod function works with pod workers as expected.
func TestKillPodNowFunc(t *testing.T) {}

func Test_allowPodStart(t *testing.T) {}

func Test_calculateEffectiveGracePeriod(t *testing.T) {}