mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 02:38:12 +00:00
Fix the rest of the code
This commit is contained in:
@@ -683,7 +683,7 @@ func getUsedPorts(pods ...*api.Pod) map[int]bool {
|
||||
// "0" is explicitly ignored in PodFitsHostPorts,
|
||||
// which is the only function that uses this value.
|
||||
if podPort.HostPort != 0 {
|
||||
ports[podPort.HostPort] = true
|
||||
ports[int(podPort.HostPort)] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ func TestPodFitsHost(t *testing.T) {
|
||||
func newPod(host string, hostPorts ...int) *api.Pod {
|
||||
networkPorts := []api.ContainerPort{}
|
||||
for _, port := range hostPorts {
|
||||
networkPorts = append(networkPorts, api.ContainerPort{HostPort: port})
|
||||
networkPorts = append(networkPorts, api.ContainerPort{HostPort: int32(port)})
|
||||
}
|
||||
return &api.Pod{
|
||||
Spec: api.PodSpec{
|
||||
@@ -1487,7 +1487,7 @@ func TestPredicatesRegistered(t *testing.T) {
|
||||
func newPodWithPort(hostPorts ...int) *api.Pod {
|
||||
networkPorts := []api.ContainerPort{}
|
||||
for _, port := range hostPorts {
|
||||
networkPorts = append(networkPorts, api.ContainerPort{HostPort: port})
|
||||
networkPorts = append(networkPorts, api.ContainerPort{HostPort: int32(port)})
|
||||
}
|
||||
return &api.Pod{
|
||||
Spec: api.PodSpec{
|
||||
|
||||
@@ -72,7 +72,7 @@ func (s *NodeAffinity) CalculateNodeAffinityPriority(pod *api.Pod, nodeNameToInf
|
||||
|
||||
for _, node := range nodes.Items {
|
||||
if nodeSelector.Matches(labels.Set(node.Labels)) {
|
||||
counts[node.Name] += preferredSchedulingTerm.Weight
|
||||
counts[node.Name] += int(preferredSchedulingTerm.Weight)
|
||||
}
|
||||
|
||||
if counts[node.Name] > maxCount {
|
||||
|
||||
Reference in New Issue
Block a user