Commit f9f4b74a authored by Mike Danese's avatar Mike Danese

Merge pull request #19449 from hongchaodeng/fitport

PodFitsHostPorts: small refactor and speedup
parents 41df8749 91fa5f8c
......@@ -513,8 +513,11 @@ func (s *ServiceAffinity) CheckServiceAffinity(pod *api.Pod, existingPods []*api
}
func PodFitsHostPorts(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) {
existingPorts := getUsedPorts(existingPods...)
wantPorts := getUsedPorts(pod)
if len(wantPorts) == 0 {
return true, nil
}
existingPorts := getUsedPorts(existingPods...)
for wport := range wantPorts {
if wport == 0 {
continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment