From ef786c9fa2d9d6d9fcc0cad635ff00b4bcd4108d Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Wed, 26 Feb 2020 17:10:39 -0800 Subject: [PATCH] Setting a Pod's nodeAffinity instead of setting .spec.nodeName directly --- test/e2e/scheduling/predicates.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/e2e/scheduling/predicates.go b/test/e2e/scheduling/predicates.go index 954e9e1666c..8689f71ff61 100644 --- a/test/e2e/scheduling/predicates.go +++ b/test/e2e/scheduling/predicates.go @@ -836,11 +836,15 @@ func initPausePod(f *framework.Framework, conf pausePodConfig) *v1.Pod { }, }, Tolerations: conf.Tolerations, - NodeName: conf.NodeName, PriorityClassName: conf.PriorityClassName, TerminationGracePeriodSeconds: &gracePeriod, }, } + // TODO: setting the Pod's nodeAffinity instead of setting .spec.nodeName works around the + // Preemption e2e flake (#88441), but we should investigate deeper to get to the bottom of it. + if len(conf.NodeName) != 0 { + e2epod.SetNodeAffinity(&pod.Spec, conf.NodeName) + } if conf.Resources != nil { pod.Spec.Containers[0].Resources = *conf.Resources }