Skip to content

Commit ef786c9

Browse files
committed
Setting a Pod's nodeAffinity instead of setting .spec.nodeName directly
1 parent 517a41f commit ef786c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/e2e/scheduling/predicates.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,11 +836,15 @@ func initPausePod(f *framework.Framework, conf pausePodConfig) *v1.Pod {
836836
},
837837
},
838838
Tolerations: conf.Tolerations,
839-
NodeName: conf.NodeName,
840839
PriorityClassName: conf.PriorityClassName,
841840
TerminationGracePeriodSeconds: &gracePeriod,
842841
},
843842
}
843+
// TODO: setting the Pod's nodeAffinity instead of setting .spec.nodeName works around the
844+
// Preemption e2e flake (#88441), but we should investigate deeper to get to the bottom of it.
845+
if len(conf.NodeName) != 0 {
846+
e2epod.SetNodeAffinity(&pod.Spec, conf.NodeName)
847+
}
844848
if conf.Resources != nil {
845849
pod.Spec.Containers[0].Resources = *conf.Resources
846850
}

0 commit comments

Comments
 (0)