kubernetes/pkg/controller/daemon/daemon_controller_test.go

var simpleDaemonSetLabel

var simpleDaemonSetLabel2

var simpleNodeLabel

var simpleNodeLabel2

var alwaysReady

var informerSyncTimeout

var noScheduleTolerations

var noScheduleTaints

var noExecuteTaints

func nowPointer() *metav1.Time {}

var nodeNotReady

var nodeUnreachable

func newDaemonSet(name string) *apps.DaemonSet {}

func newRollingUpdateStrategy() *apps.DaemonSetUpdateStrategy {}

func newOnDeleteStrategy() *apps.DaemonSetUpdateStrategy {}

func updateStrategies() []*apps.DaemonSetUpdateStrategy {}

func newNode(name string, label map[string]string) *v1.Node {}

func addNodes(nodeStore cache.Store, startIndex, numNodes int, label map[string]string) {}

func newPod(podName string, nodeName string, label map[string]string, ds *apps.DaemonSet) *v1.Pod {}

func addPods(podStore cache.Store, nodeName string, label map[string]string, ds *apps.DaemonSet, number int) {}

func addFailedPods(podStore cache.Store, nodeName string, label map[string]string, ds *apps.DaemonSet, number int) {}

func newControllerRevision(name string, namespace string, label map[string]string,
	ownerReferences []metav1.OwnerReference) *apps.ControllerRevision {}

type fakePodControl

func newFakePodControl() *fakePodControl {}

func (f *fakePodControl) CreatePods(ctx context.Context, namespace string, template *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference) error {}

func (f *fakePodControl) DeletePod(ctx context.Context, namespace string, podID string, object runtime.Object) error {}

type daemonSetsController

func newTestController(ctx context.Context, initialObjects ...runtime.Object) (*daemonSetsController, *fakePodControl, *fake.Clientset, error) {}

func resetCounters(manager *daemonSetsController) {}

func validateSyncDaemonSets(manager *daemonSetsController, fakePodControl *fakePodControl, expectedCreates, expectedDeletes int, expectedEvents int) error {}

func expectSyncDaemonSets(t *testing.T, manager *daemonSetsController, ds *apps.DaemonSet, podControl *fakePodControl, expectedCreates, expectedDeletes int, expectedEvents int) {}

func expectSyncDaemonSetsWithError(t *testing.T, manager *daemonSetsController, ds *apps.DaemonSet, podControl *fakePodControl, expectedCreates, expectedDeletes int, expectedEvents int, expectedError error) {}

// clearExpectations copies the FakePodControl to PodStore and clears the create and delete expectations.
func clearExpectations(t *testing.T, manager *daemonSetsController, ds *apps.DaemonSet, fakePodControl *fakePodControl) {}

func TestDeleteFinalStateUnknown(t *testing.T) {}

func TestExpectationsOnRecreate(t *testing.T) {}

func markPodsReady(store cache.Store) {}

func markPodReady(pod *v1.Pod) {}

// DaemonSets without node selectors should launch pods on every node.
func TestSimpleDaemonSetLaunchesPods(t *testing.T) {}

// DaemonSets without node selectors should launch pods on every node by NodeAffinity.
func TestSimpleDaemonSetScheduleDaemonSetPodsLaunchesPods(t *testing.T) {}

// Simulate a cluster with 100 nodes, but simulate a limit (like a quota limit)
// of 10 pods, and verify that the ds doesn't make 100 create calls per sync pass
func TestSimpleDaemonSetPodCreateErrors(t *testing.T) {}

func TestDaemonSetPodCreateExpectationsError(t *testing.T) {}

func TestSimpleDaemonSetUpdatesStatusAfterLaunchingPods(t *testing.T) {}

func TestSimpleDaemonSetUpdatesStatusError(t *testing.T) {}

// DaemonSets should do nothing if there aren't any nodes
func TestNoNodesDoesNothing(t *testing.T) {}

// DaemonSets without node selectors should launch on a single node in a
// single node cluster.
func TestOneNodeDaemonLaunchesPod(t *testing.T) {}

// DaemonSets should place onto NotReady nodes
func TestNotReadyNodeDaemonDoesLaunchPod(t *testing.T) {}

func resourcePodSpec(nodeName, memory, cpu string) v1.PodSpec {}

func resourceContainerSpec(memory, cpu string) v1.ResourceRequirements {}

func resourcePodSpecWithoutNodeName(memory, cpu string) v1.PodSpec {}

func allocatableResources(memory, cpu string) v1.ResourceList {}

// DaemonSets should not unschedule a daemonset pod from a node with insufficient free resource
func TestInsufficientCapacityNodeDaemonDoesNotUnscheduleRunningPod(t *testing.T) {}

// DaemonSets should only place onto nodes with sufficient free resource and matched node selector
func TestInsufficientCapacityNodeSufficientCapacityWithNodeLabelDaemonLaunchPod(t *testing.T) {}

// DaemonSet should launch a pod on a node with taint NetworkUnavailable condition.
func TestNetworkUnavailableNodeDaemonLaunchesPod(t *testing.T) {}

// DaemonSets not take any actions when being deleted
func TestDontDoAnythingIfBeingDeleted(t *testing.T) {}

func TestDontDoAnythingIfBeingDeletedRace(t *testing.T) {}

// Test that if the node is already scheduled with a pod using a host port
// but belonging to the same daemonset, we don't delete that pod
//
// Issue: https://github.com/kubernetes/kubernetes/issues/22309
func TestPortConflictWithSameDaemonPodDoesNotDeletePod(t *testing.T) {}

// DaemonSets should place onto nodes that would not cause port conflicts
func TestNoPortConflictNodeDaemonLaunchesPod(t *testing.T) {}

// DaemonSetController should not sync DaemonSets with empty pod selectors.
//
// issue https://github.com/kubernetes/kubernetes/pull/23223
func TestPodIsNotDeletedByDaemonsetWithEmptyLabelSelector(t *testing.T) {}

// Controller should not create pods on nodes which have daemon pods, and should remove excess pods from nodes that have extra pods.
func TestDealsWithExistingPods(t *testing.T) {}

// Daemon with node selector should launch pods on nodes matching selector.
func TestSelectorDaemonLaunchesPods(t *testing.T) {}

// Daemon with node selector should delete pods from nodes that do not satisfy selector.
func TestSelectorDaemonDeletesUnselectedPods(t *testing.T) {}

// DaemonSet with node selector should launch pods on nodes matching selector, but also deal with existing pods on nodes.
func TestSelectorDaemonDealsWithExistingPods(t *testing.T) {}

// DaemonSet with node selector which does not match any node labels should not launch pods.
func TestBadSelectorDaemonDoesNothing(t *testing.T) {}

// DaemonSet with node name should launch pod on node with corresponding name.
func TestNameDaemonSetLaunchesPods(t *testing.T) {}

// DaemonSet with node name that does not exist should not launch pods.
func TestBadNameDaemonSetDoesNothing(t *testing.T) {}

// DaemonSet with node selector, and node name, matching a node, should launch a pod on the node.
func TestNameAndSelectorDaemonSetLaunchesPods(t *testing.T) {}

// DaemonSet with node selector that matches some nodes, and node name that matches a different node, should do nothing.
func TestInconsistentNameSelectorDaemonSetDoesNothing(t *testing.T) {}

// DaemonSet with node selector, matching some nodes, should launch pods on all the nodes.
func TestSelectorDaemonSetLaunchesPods(t *testing.T) {}

// Daemon with node affinity should launch pods on nodes matching affinity.
func TestNodeAffinityDaemonLaunchesPods(t *testing.T) {}

func TestNumberReadyStatus(t *testing.T) {}

func TestObservedGeneration(t *testing.T) {}

// DaemonSet controller should kill all failed pods and create at most 1 pod on every node.
func TestDaemonKillFailedPods(t *testing.T) {}

// DaemonSet controller needs to backoff when killing failed pods to avoid hot looping and fighting with kubelet.
func TestDaemonKillFailedPodsBackoff(t *testing.T) {}

// Daemonset should not remove a running pod from a node if the pod doesn't
// tolerate the nodes NoSchedule taint
func TestNoScheduleTaintedDoesntEvicitRunningIntolerantPod(t *testing.T) {}

// Daemonset should remove a running pod from a node if the pod doesn't
// tolerate the nodes NoExecute taint
func TestNoExecuteTaintedDoesEvicitRunningIntolerantPod(t *testing.T) {}

// DaemonSet should not launch a pod on a tainted node when the pod doesn't tolerate that taint.
func TestTaintedNodeDaemonDoesNotLaunchIntolerantPod(t *testing.T) {}

// DaemonSet should launch a pod on a tainted node when the pod can tolerate that taint.
func TestTaintedNodeDaemonLaunchesToleratePod(t *testing.T) {}

// DaemonSet should launch a pod on a not ready node with taint notReady:NoExecute.
func TestNotReadyNodeDaemonLaunchesPod(t *testing.T) {}

// DaemonSet should launch a pod on an unreachable node with taint unreachable:NoExecute.
func TestUnreachableNodeDaemonLaunchesPod(t *testing.T) {}

// DaemonSet should launch a pod on an untainted node when the pod has tolerations.
func TestNodeDaemonLaunchesToleratePod(t *testing.T) {}

// DaemonSet should launch a pod on a not ready node with taint notReady:NoExecute.
func TestDaemonSetRespectsTermination(t *testing.T) {}

func setNodeTaint(node *v1.Node, taints []v1.Taint) {}

func setDaemonSetToleration(ds *apps.DaemonSet, tolerations []v1.Toleration) {}

// DaemonSet should launch a pod even when the node with MemoryPressure/DiskPressure/PIDPressure taints.
func TestTaintPressureNodeDaemonLaunchesPod(t *testing.T) {}

func setDaemonSetCritical(ds *apps.DaemonSet) {}

func TestNodeShouldRunDaemonPod(t *testing.T) {}

// DaemonSets should be resynced when node labels or taints changed
func TestUpdateNode(t *testing.T) {}

// DaemonSets should be resynced when non-daemon pods was deleted.
func TestDeleteNoDaemonPod(t *testing.T) {}

func TestDeleteUnscheduledPodForNotExistingNode(t *testing.T) {}

func TestGetNodesToDaemonPods(t *testing.T) {}

func TestAddNode(t *testing.T) {}

func TestAddPod(t *testing.T) {}

func TestAddPodOrphan(t *testing.T) {}

func TestUpdatePod(t *testing.T) {}

func TestUpdatePodOrphanSameLabels(t *testing.T) {}

func TestUpdatePodOrphanWithNewLabels(t *testing.T) {}

func TestUpdatePodChangeControllerRef(t *testing.T) {}

func TestUpdatePodControllerRefRemoved(t *testing.T) {}

func TestDeletePod(t *testing.T) {}

func TestDeletePodOrphan(t *testing.T) {}

func bumpResourceVersion(obj metav1.Object) {}

// getQueuedKeys returns a sorted list of keys in the queue.
// It can be used to quickly check that multiple keys are in there.
func getQueuedKeys(queue workqueue.TypedRateLimitingInterface[string]) []string {}

// Controller should not create pods on nodes which have daemon pods, and should remove excess pods from nodes that have extra pods.
func TestSurgeDealsWithExistingPods(t *testing.T) {}

func TestSurgePreservesReadyOldPods(t *testing.T) {}

func TestSurgeCreatesNewPodWhenAtMaxSurgeAndOldPodDeleted(t *testing.T) {}

func TestSurgeDeletesUnreadyOldPods(t *testing.T) {}

func TestSurgePreservesOldReadyWithUnsatisfiedMinReady(t *testing.T) {}

func TestSurgeDeletesOldReadyWithUnsatisfiedMinReady(t *testing.T) {}

func TestStoreDaemonSetStatus(t *testing.T) {}

func TestShouldIgnoreNodeUpdate(t *testing.T) {}