Don't require failureDomains in PodAffinityChecker
failureDomains are only used for PreferredDuringScheduling pod anti-affinity, which is ignored by PodAffinityChecker. This unnecessary requirement was making it hard to move PodAffinityChecker to GeneralPredicates because that would require passing --failure-domains to both kubelet and kube-controller-manager.
This commit is contained in:
@@ -21,7 +21,6 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"k8s.io/gengo/parser"
|
||||
@@ -30,7 +29,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/util/codeinspector"
|
||||
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithm"
|
||||
priorityutil "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/priorities/util"
|
||||
"k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache"
|
||||
)
|
||||
|
||||
@@ -2463,9 +2461,8 @@ func TestInterPodAffinity(t *testing.T) {
|
||||
}
|
||||
|
||||
fit := PodAffinityChecker{
|
||||
info: FakeNodeInfo(*node),
|
||||
podLister: algorithm.FakePodLister(test.pods),
|
||||
failureDomains: priorityutil.Topologies{DefaultKeys: strings.Split(v1.DefaultFailureDomains, ",")},
|
||||
info: FakeNodeInfo(*node),
|
||||
podLister: algorithm.FakePodLister(test.pods),
|
||||
}
|
||||
nodeInfo := schedulercache.NewNodeInfo(podsOnNode...)
|
||||
nodeInfo.SetNode(test.node)
|
||||
@@ -2708,9 +2705,8 @@ func TestInterPodAffinityWithMultipleNodes(t *testing.T) {
|
||||
}
|
||||
|
||||
testFit := PodAffinityChecker{
|
||||
info: nodeListInfo,
|
||||
podLister: algorithm.FakePodLister(test.pods),
|
||||
failureDomains: priorityutil.Topologies{DefaultKeys: strings.Split(v1.DefaultFailureDomains, ",")},
|
||||
info: nodeListInfo,
|
||||
podLister: algorithm.FakePodLister(test.pods),
|
||||
}
|
||||
nodeInfo := schedulercache.NewNodeInfo(podsOnNode...)
|
||||
nodeInfo.SetNode(&node)
|
||||
|
Reference in New Issue
Block a user