Merge pull request #14724 from HaiyangDING/PodFitsHostPorts

Replace PodFitsPorts with PodFitsHostPorts
This commit is contained in:
David Oppenheimer
2015-10-03 12:45:35 -07:00
6 changed files with 15 additions and 7 deletions

View File

@@ -356,7 +356,7 @@ func (s *ServiceAffinity) CheckServiceAffinity(pod *api.Pod, existingPods []*api
return affinitySelector.Matches(labels.Set(node.Labels)), nil
}
func PodFitsPorts(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) {
func PodFitsHostPorts(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) {
existingPorts := getUsedPorts(existingPods...)
wantPorts := getUsedPorts(pod)
for wport := range wantPorts {

View File

@@ -244,7 +244,7 @@ func newPod(host string, hostPorts ...int) *api.Pod {
}
}
func TestPodFitsPorts(t *testing.T) {
func TestPodFitsHostPorts(t *testing.T) {
tests := []struct {
pod *api.Pod
existingPods []*api.Pod
@@ -291,7 +291,7 @@ func TestPodFitsPorts(t *testing.T) {
},
}
for _, test := range tests {
fits, err := PodFitsPorts(test.pod, test.existingPods, "machine")
fits, err := PodFitsHostPorts(test.pod, test.existingPods, "machine")
if err != nil {
t.Errorf("unexpected error: %v", err)
}