mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Add unit test for daemonset with network unavailable node
This commit is contained in:
parent
7bdf54a30a
commit
16b88e7e14
@ -448,6 +448,22 @@ func TestSufficientCapacityNodeDaemonLaunchesPod(t *testing.T) {
|
|||||||
syncAndValidateDaemonSets(t, manager, ds, podControl, 1, 0)
|
syncAndValidateDaemonSets(t, manager, ds, podControl, 1, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DaemonSet should launch a pod on a node with taint NetworkUnavailable condition.
|
||||||
|
func TestNetworkUnavailableNodeDaemonLaunchesPod(t *testing.T) {
|
||||||
|
manager, podControl, _ := newTestController()
|
||||||
|
|
||||||
|
node := newNode("network-unavailable", nil)
|
||||||
|
node.Status.Conditions = []v1.NodeCondition{
|
||||||
|
{Type: v1.NodeNetworkUnavailable, Status: v1.ConditionTrue},
|
||||||
|
}
|
||||||
|
manager.nodeStore.Add(node)
|
||||||
|
|
||||||
|
ds := newDaemonSet("simple")
|
||||||
|
manager.dsStore.Add(ds)
|
||||||
|
|
||||||
|
syncAndValidateDaemonSets(t, manager, ds, podControl, 1, 0)
|
||||||
|
}
|
||||||
|
|
||||||
// DaemonSets not take any actions when being deleted
|
// DaemonSets not take any actions when being deleted
|
||||||
func TestDontDoAnythingIfBeingDeleted(t *testing.T) {
|
func TestDontDoAnythingIfBeingDeleted(t *testing.T) {
|
||||||
podSpec := resourcePodSpec("not-too-much-mem", "75M", "75m")
|
podSpec := resourcePodSpec("not-too-much-mem", "75M", "75m")
|
||||||
|
Loading…
Reference in New Issue
Block a user