mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #46695 from gyliu513/daemoncontrollertest
Automatic merge from submit-queue (batch tested with PRs 46726, 41912, 46695, 46034, 46551) Added a new test case for daemoncontroller. This patch added a new test case of daemonSet with node selector, matching some nodes, and launch pods on all the nodes. **What this PR does / why we need it**: **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note ```
This commit is contained in:
commit
9baeab9dd8
@ -787,6 +787,17 @@ func TestInconsistentNameSelectorDaemonSetDoesNothing(t *testing.T) {
|
|||||||
syncAndValidateDaemonSets(t, manager, ds, podControl, 0, 0)
|
syncAndValidateDaemonSets(t, manager, ds, podControl, 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DaemonSet with node selector, matching some nodes, should launch pods on all the nodes.
|
||||||
|
func TestSelectorDaemonSetLaunchesPods(t *testing.T) {
|
||||||
|
ds := newDaemonSet("foo")
|
||||||
|
ds.Spec.Template.Spec.NodeSelector = simpleNodeLabel
|
||||||
|
manager, podControl, _ := newTestController(ds)
|
||||||
|
addNodes(manager.nodeStore, 0, 4, nil)
|
||||||
|
addNodes(manager.nodeStore, 4, 3, simpleNodeLabel)
|
||||||
|
manager.dsStore.Add(ds)
|
||||||
|
syncAndValidateDaemonSets(t, manager, ds, podControl, 3, 0)
|
||||||
|
}
|
||||||
|
|
||||||
// Daemon with node affinity should launch pods on nodes matching affinity.
|
// Daemon with node affinity should launch pods on nodes matching affinity.
|
||||||
func TestNodeAffinityDaemonLaunchesPods(t *testing.T) {
|
func TestNodeAffinityDaemonLaunchesPods(t *testing.T) {
|
||||||
daemon := newDaemonSet("foo")
|
daemon := newDaemonSet("foo")
|
||||||
|
Loading…
Reference in New Issue
Block a user