Setting a Pod's nodeAffinity instead of setting .spec.nodeName directly

This commit is contained in:
Wei Huang 2020-02-26 17:10:39 -08:00
parent 517a41fe84
commit ef786c9fa2
No known key found for this signature in database
GPG Key ID: BE5E9752F8B6E005

View File

@ -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
}