kubernetes/pkg/kubelet/kubelet_test.go

func init() {}

const testKubeletHostname

const testKubeletHostIP

const testKubeletHostIPv6

const minImgSize

const maxImgSize

type fakeImageGCManager

func (f *fakeImageGCManager) GetImageList() ([]kubecontainer.Image, error) {}

type TestKubelet

func (tk *TestKubelet) Cleanup() {}

// newTestKubelet returns test kubelet with two images.
func newTestKubelet(t *testing.T, controllerAttachDetachEnabled bool) *TestKubelet {}

func newTestKubeletWithImageList(
	t *testing.T,
	imageList []kubecontainer.Image,
	controllerAttachDetachEnabled bool,
	initFakeVolumePlugin bool,
	localStorageCapacityIsolation bool,
) *TestKubelet {}

func newTestPods(count int) []*v1.Pod {}

func TestSyncLoopAbort(t *testing.T) {}

func TestSyncPodsStartPod(t *testing.T) {}

func TestHandlePodCleanupsPerQOS(t *testing.T) {}

func TestDispatchWorkOfCompletedPod(t *testing.T) {}

func TestDispatchWorkOfActivePod(t *testing.T) {}

func TestHandlePodCleanups(t *testing.T) {}

func TestHandlePodRemovesWhenSourcesAreReady(t *testing.T) {}

type testNodeLister

func (nl testNodeLister) Get(name string) (*v1.Node, error) {}

func (nl testNodeLister) List(_ labels.Selector) (ret []*v1.Node, err error) {}

func checkPodStatus(t *testing.T, kl *Kubelet, pod *v1.Pod, phase v1.PodPhase) {}

// Tests that we handle port conflicts correctly by setting the failed status in status map.
func TestHandlePortConflicts(t *testing.T) {}

// Tests that we handle host name conflicts correctly by setting the failed status in status map.
func TestHandleHostNameConflicts(t *testing.T) {}

// Tests that we handle not matching labels selector correctly by setting the failed status in status map.
func TestHandleNodeSelector(t *testing.T) {}

// Tests that we handle not matching labels selector correctly by setting the failed status in status map.
func TestHandleNodeSelectorBasedOnOS(t *testing.T) {}

// Tests that we handle exceeded resources correctly by setting the failed status in status map.
func TestHandleMemExceeded(t *testing.T) {}

// Tests that we handle result of interface UpdatePluginResources correctly
// by setting corresponding status in status map.
func TestHandlePluginResources(t *testing.T) {}

// TODO(filipg): This test should be removed once StatusSyncer can do garbage collection without external signal.
func TestPurgingObsoleteStatusMapEntries(t *testing.T) {}

func TestValidateContainerLogStatus(t *testing.T) {}

func TestCreateMirrorPod(t *testing.T) {}

func TestDeleteOutdatedMirrorPod(t *testing.T) {}

func TestDeleteOrphanedMirrorPods(t *testing.T) {}

func TestNetworkErrorsWithoutHostNetwork(t *testing.T) {}

func TestFilterOutInactivePods(t *testing.T) {}

func TestCheckpointContainer(t *testing.T) {}

func TestSyncPodsSetStatusToFailedForPodsThatRunTooLong(t *testing.T) {}

func TestSyncPodsDoesNotSetPodsThatDidNotRunTooLongToFailed(t *testing.T) {}

func podWithUIDNameNs(uid types.UID, name, namespace string) *v1.Pod {}

func podWithUIDNameNsSpec(uid types.UID, name, namespace string, spec v1.PodSpec) *v1.Pod {}

func TestDeletePodDirsForDeletedPods(t *testing.T) {}

func syncAndVerifyPodDir(t *testing.T, testKubelet *TestKubelet, pods []*v1.Pod, podsToCheck []*v1.Pod, shouldExist bool) {}

func TestDoesNotDeletePodDirsForTerminatedPods(t *testing.T) {}

func TestDoesNotDeletePodDirsIfContainerIsRunning(t *testing.T) {}

func TestGetPodsToSync(t *testing.T) {}

func TestGenerateAPIPodStatusWithSortedContainers(t *testing.T) {}

func verifyContainerStatuses(t *testing.T, statuses []v1.ContainerStatus, expectedState, expectedLastTerminationState map[string]v1.ContainerState, message string) {}

// Test generateAPIPodStatus with different reason cache and old api pod status.
func TestGenerateAPIPodStatusWithReasonCache(t *testing.T) {}

// Test generateAPIPodStatus with different restart policies.
func TestGenerateAPIPodStatusWithDifferentRestartPolicies(t *testing.T) {}

type testPodAdmitHandler

// Admit rejects all pods in the podsToReject list with a matching UID.
func (a *testPodAdmitHandler) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitResult {}

// Test verifies that the kubelet invokes an admission handler during HandlePodAdditions.
func TestHandlePodAdditionsInvokesPodAdmitHandlers(t *testing.T) {}

func TestPodResourceAllocationReset(t *testing.T) {}

func TestHandlePodResourcesResize(t *testing.T) {}

type testPodSyncLoopHandler

// ShouldSync evaluates if the pod should be synced from the kubelet.
func (a *testPodSyncLoopHandler) ShouldSync(pod *v1.Pod) bool {}

// TestGetPodsToSyncInvokesPodSyncLoopHandlers ensures that the get pods to sync routine invokes the handler.
func TestGetPodsToSyncInvokesPodSyncLoopHandlers(t *testing.T) {}

type testPodSyncHandler

// ShouldEvict evaluates if the pod should be evicted from the kubelet.
func (a *testPodSyncHandler) ShouldEvict(pod *v1.Pod) lifecycle.ShouldEvictResponse {}

// TestGenerateAPIPodStatusInvokesPodSyncHandlers invokes the handlers and reports the proper status
func TestGenerateAPIPodStatusInvokesPodSyncHandlers(t *testing.T) {}

func TestSyncTerminatingPodKillPod(t *testing.T) {}

func TestSyncLabels(t *testing.T) {}

func waitForVolumeUnmount(
	volumeManager kubeletvolume.VolumeManager,
	pod *v1.Pod) error {}

func waitForVolumeDetach(
	volumeName v1.UniqueVolumeName,
	volumeManager kubeletvolume.VolumeManager) error {}

func retryWithExponentialBackOff(initialDuration time.Duration, fn wait.ConditionFunc) error {}

func simulateVolumeInUseUpdate(
	volumeName v1.UniqueVolumeName,
	stopCh <-chan struct{}

// dirExists returns true if the path exists and represents a directory.
func dirExists(path string) bool {}

type podsByUID

func (p podsByUID) Len() int           {}

func (p podsByUID) Swap(i, j int)      {}

func (p podsByUID) Less(i, j int) bool {}

// createAndStartFakeRemoteRuntime creates and starts fakeremote.RemoteRuntime.
// It returns the RemoteRuntime, endpoint on success.
// Users should call fakeRuntime.Stop() to cleanup the server.
func createAndStartFakeRemoteRuntime(t *testing.T) (*fakeremote.RemoteRuntime, string) {}

func createRemoteRuntimeService(endpoint string, t *testing.T, tp oteltrace.TracerProvider) internalapi.RuntimeService {}

func TestNewMainKubeletStandAlone(t *testing.T) {}

func TestSyncPodSpans(t *testing.T) {}

func TestIsPodResizeInProgress(t *testing.T) {}