mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
refactor(node_taint_test): apply pod single creation convention for p9
This commit is contained in:
@@ -153,21 +153,9 @@ func TestDeletePodsViolatingNodeTaints(t *testing.T) {
|
||||
p8 := buildTestPod("p8", nodeName2, func(pod *v1.Pod) {
|
||||
pod.ObjectMeta.OwnerReferences = test.GetDaemonSetOwnerRefList()
|
||||
})
|
||||
p9 := buildTestPod("p9", nodeName2, nil)
|
||||
p10 := buildTestPod("p10", nodeName2, nil)
|
||||
p11 := buildTestPod("p11", nodeName2, nil)
|
||||
p12 := buildTestPod("p11", nodeName2, nil)
|
||||
p9.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
|
||||
p10.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
|
||||
p11.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
|
||||
p12.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
|
||||
|
||||
// The following 4 pods won't get evicted.
|
||||
// A Critical Pod.
|
||||
// A daemonset.
|
||||
// A pod with local storage.
|
||||
p9.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
|
||||
p9.Spec.Volumes = []v1.Volume{
|
||||
p9 := buildTestPod("p9", nodeName2, func(pod *v1.Pod) {
|
||||
pod.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
|
||||
pod.Spec.Volumes = []v1.Volume{
|
||||
{
|
||||
Name: "sample",
|
||||
VolumeSource: v1.VolumeSource{
|
||||
@@ -178,6 +166,18 @@ func TestDeletePodsViolatingNodeTaints(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
p10 := buildTestPod("p10", nodeName2, nil)
|
||||
p11 := buildTestPod("p11", nodeName2, nil)
|
||||
p12 := buildTestPod("p11", nodeName2, nil)
|
||||
p10.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
|
||||
p11.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
|
||||
p12.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
|
||||
|
||||
// The following 4 pods won't get evicted.
|
||||
// A Critical Pod.
|
||||
// A daemonset.
|
||||
// A pod with local storage.
|
||||
// A Mirror Pod.
|
||||
p10.Annotations = test.GetMirrorPodAnnotation()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user