mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
refactor(TestPodAntiAffinity): inline p5
This commit is contained in:
@@ -117,12 +117,6 @@ func buildTestPodNonEvictableForNode1() *v1.Pod {
|
|||||||
|
|
||||||
func TestPodAntiAffinity(t *testing.T) {
|
func TestPodAntiAffinity(t *testing.T) {
|
||||||
|
|
||||||
p5 := buildTestPodForNode1("p5", func(pod *v1.Pod) {
|
|
||||||
test.SetNormalOwnerRef(pod)
|
|
||||||
setLabelsFooBar(pod)
|
|
||||||
setPodAntiAffinityFoo1Bar1(pod)
|
|
||||||
test.SetPodPriority(pod, 100)
|
|
||||||
})
|
|
||||||
p6 := buildTestPodForNode1("p6", func(pod *v1.Pod) {
|
p6 := buildTestPodForNode1("p6", func(pod *v1.Pod) {
|
||||||
test.SetNormalOwnerRef(pod)
|
test.SetNormalOwnerRef(pod)
|
||||||
setLabelsFooBar(pod)
|
setLabelsFooBar(pod)
|
||||||
@@ -224,7 +218,14 @@ func TestPodAntiAffinity(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "Evict only 1 pod after sorting",
|
description: "Evict only 1 pod after sorting",
|
||||||
pods: []*v1.Pod{p5, p6, p7},
|
pods: []*v1.Pod{
|
||||||
|
buildTestPodForNode1("p5", func(pod *v1.Pod) {
|
||||||
|
test.SetNormalOwnerRef(pod)
|
||||||
|
setLabelsFooBar(pod)
|
||||||
|
setPodAntiAffinityFoo1Bar1(pod)
|
||||||
|
test.SetPodPriority(pod, 100)
|
||||||
|
}),
|
||||||
|
p6, p7},
|
||||||
nodes: []*v1.Node{
|
nodes: []*v1.Node{
|
||||||
buildTestNode1(),
|
buildTestNode1(),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user