mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-28 06:29:29 +01:00
refactor(TestFindDuplicatePods): inline node3 creation
This commit is contained in:
@@ -79,15 +79,6 @@ func buildTestPodWithRSOwnerRefWithNamespaceForNode1(name, namespace string, app
|
|||||||
|
|
||||||
func TestFindDuplicatePods(t *testing.T) {
|
func TestFindDuplicatePods(t *testing.T) {
|
||||||
// first setup pods
|
// first setup pods
|
||||||
node3 := buildTestNode(nodeName3, func(node *v1.Node) {
|
|
||||||
node.Spec.Taints = []v1.Taint{
|
|
||||||
{
|
|
||||||
Key: "hardware",
|
|
||||||
Value: "gpu",
|
|
||||||
Effect: v1.TaintEffectNoSchedule,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
node4 := buildTestNode(nodeName4, func(node *v1.Node) {
|
node4 := buildTestNode(nodeName4, func(node *v1.Node) {
|
||||||
node.ObjectMeta.Labels = map[string]string{
|
node.ObjectMeta.Labels = map[string]string{
|
||||||
"datacenter": "east",
|
"datacenter": "east",
|
||||||
@@ -318,7 +309,15 @@ func TestFindDuplicatePods(t *testing.T) {
|
|||||||
},
|
},
|
||||||
nodes: []*v1.Node{
|
nodes: []*v1.Node{
|
||||||
buildTestNode(nodeName1, nil),
|
buildTestNode(nodeName1, nil),
|
||||||
node3,
|
buildTestNode(nodeName3, func(node *v1.Node) {
|
||||||
|
node.Spec.Taints = []v1.Taint{
|
||||||
|
{
|
||||||
|
Key: "hardware",
|
||||||
|
Value: "gpu",
|
||||||
|
Effect: v1.TaintEffectNoSchedule,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
expectedEvictedPodCount: 0,
|
expectedEvictedPodCount: 0,
|
||||||
nodefit: true,
|
nodefit: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user