[scheduler cleanup phase 1]: Move NodeInfo utils into pkg/scheduler/cache

This commit is contained in:
Guoliang Wang
2018-10-07 00:34:37 +08:00
parent c63462ada0
commit a50404d441
10 changed files with 393 additions and 356 deletions

View File

@@ -19,7 +19,7 @@ package predicates
import (
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
schedutil "k8s.io/kubernetes/pkg/scheduler/util"
schedulercache "k8s.io/kubernetes/pkg/scheduler/cache"
)
// FindLabelsInSet gets as many key/value pairs as possible out of a label set.
@@ -68,7 +68,7 @@ func CreateSelectorFromLabels(aL map[string]string) labels.Selector {
// portsConflict check whether existingPorts and wantPorts conflict with each other
// return true if we have a conflict
func portsConflict(existingPorts schedutil.HostPortInfo, wantPorts []*v1.ContainerPort) bool {
func portsConflict(existingPorts schedulercache.HostPortInfo, wantPorts []*v1.ContainerPort) bool {
for _, cp := range wantPorts {
if existingPorts.CheckConflict(cp.HostIP, string(cp.Protocol), cp.HostPort) {
return true