mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
Merge pull request #88556 from Huang-Wei/sched-e2e-flake-part2
Fix a scheduler e2e bug on Preemption
This commit is contained in:
commit
0bd694033a
@ -836,11 +836,15 @@ func initPausePod(f *framework.Framework, conf pausePodConfig) *v1.Pod {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Tolerations: conf.Tolerations,
|
Tolerations: conf.Tolerations,
|
||||||
NodeName: conf.NodeName,
|
|
||||||
PriorityClassName: conf.PriorityClassName,
|
PriorityClassName: conf.PriorityClassName,
|
||||||
TerminationGracePeriodSeconds: &gracePeriod,
|
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 {
|
if conf.Resources != nil {
|
||||||
pod.Spec.Containers[0].Resources = *conf.Resources
|
pod.Spec.Containers[0].Resources = *conf.Resources
|
||||||
}
|
}
|
||||||
|
@ -214,14 +214,14 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() {
|
|||||||
if len(pods) == 0 {
|
if len(pods) == 0 {
|
||||||
priorityName = lowPriorityClassName
|
priorityName = lowPriorityClassName
|
||||||
}
|
}
|
||||||
pods[i] = createPausePod(f, pausePodConfig{
|
pods = append(pods, createPausePod(f, pausePodConfig{
|
||||||
Name: fmt.Sprintf("pod%d-%v", i, priorityName),
|
Name: fmt.Sprintf("pod%d-%v", i, priorityName),
|
||||||
PriorityClassName: priorityName,
|
PriorityClassName: priorityName,
|
||||||
Resources: &v1.ResourceRequirements{
|
Resources: &v1.ResourceRequirements{
|
||||||
Requests: podRes,
|
Requests: podRes,
|
||||||
},
|
},
|
||||||
NodeName: node.Name,
|
NodeName: node.Name,
|
||||||
})
|
}))
|
||||||
framework.Logf("Created pod: %v", pods[i].Name)
|
framework.Logf("Created pod: %v", pods[i].Name)
|
||||||
}
|
}
|
||||||
if len(pods) < 2 {
|
if len(pods) < 2 {
|
||||||
|
Loading…
Reference in New Issue
Block a user