@@ -80,15 +80,15 @@ func (s *SelectorSpread) CalculateSpreadPriorityMap(pod *v1.Pod, meta interface{
80
80
if len (selectors ) == 0 {
81
81
return schedulerapi.HostPriority {
82
82
Host : node .Name ,
83
- Score : int ( 0 ) ,
83
+ Score : 0 ,
84
84
}, nil
85
85
}
86
86
87
87
count := countMatchingPods (pod .Namespace , selectors , nodeInfo )
88
88
89
89
return schedulerapi.HostPriority {
90
90
Host : node .Name ,
91
- Score : count ,
91
+ Score : int64 ( count ) ,
92
92
}, nil
93
93
}
94
94
@@ -97,9 +97,9 @@ func (s *SelectorSpread) CalculateSpreadPriorityMap(pod *v1.Pod, meta interface{
97
97
// where zone information is included on the nodes, it favors nodes
98
98
// in zones with fewer existing matching pods.
99
99
func (s * SelectorSpread ) CalculateSpreadPriorityReduce (pod * v1.Pod , meta interface {}, nodeNameToInfo map [string ]* schedulernodeinfo.NodeInfo , result schedulerapi.HostPriorityList ) error {
100
- countsByZone := make (map [string ]int , 10 )
101
- maxCountByZone := int (0 )
102
- maxCountByNodeName := int (0 )
100
+ countsByZone := make (map [string ]int64 , 10 )
101
+ maxCountByZone := int64 (0 )
102
+ maxCountByNodeName := int64 (0 )
103
103
104
104
for i := range result {
105
105
if result [i ].Score > maxCountByNodeName {
@@ -141,10 +141,10 @@ func (s *SelectorSpread) CalculateSpreadPriorityReduce(pod *v1.Pod, meta interfa
141
141
fScore = (fScore * (1.0 - zoneWeighting )) + (zoneWeighting * zoneScore )
142
142
}
143
143
}
144
- result [i ].Score = int (fScore )
144
+ result [i ].Score = int64 (fScore )
145
145
if klog .V (10 ) {
146
146
klog .Infof (
147
- "%v -> %v: SelectorSpreadPriority, Score: (%d)" , pod .Name , result [i ].Host , int (fScore ),
147
+ "%v -> %v: SelectorSpreadPriority, Score: (%d)" , pod .Name , result [i ].Host , int64 (fScore ),
148
148
)
149
149
}
150
150
}
@@ -232,16 +232,16 @@ func (s *ServiceAntiAffinity) CalculateAntiAffinityPriorityMap(pod *v1.Pod, meta
232
232
233
233
return schedulerapi.HostPriority {
234
234
Host : node .Name ,
235
- Score : score ,
235
+ Score : int64 ( score ) ,
236
236
}, nil
237
237
}
238
238
239
239
// CalculateAntiAffinityPriorityReduce computes each node score with the same value for a particular label.
240
240
// The label to be considered is provided to the struct (ServiceAntiAffinity).
241
241
func (s * ServiceAntiAffinity ) CalculateAntiAffinityPriorityReduce (pod * v1.Pod , meta interface {}, nodeNameToInfo map [string ]* schedulernodeinfo.NodeInfo , result schedulerapi.HostPriorityList ) error {
242
- var numServicePods int
242
+ var numServicePods int64
243
243
var label string
244
- podCounts := map [string ]int {}
244
+ podCounts := map [string ]int64 {}
245
245
labelNodesStatus := map [string ]string {}
246
246
maxPriorityFloat64 := float64 (schedulerapi .MaxPriority )
247
247
@@ -261,7 +261,7 @@ func (s *ServiceAntiAffinity) CalculateAntiAffinityPriorityReduce(pod *v1.Pod, m
261
261
label , ok := labelNodesStatus [hostPriority .Host ]
262
262
if ! ok {
263
263
result [i ].Host = hostPriority .Host
264
- result [i ].Score = int ( 0 )
264
+ result [i ].Score = 0
265
265
continue
266
266
}
267
267
// initializing to the default/max node score of maxPriority
@@ -270,7 +270,7 @@ func (s *ServiceAntiAffinity) CalculateAntiAffinityPriorityReduce(pod *v1.Pod, m
270
270
fScore = maxPriorityFloat64 * (float64 (numServicePods - podCounts [label ]) / float64 (numServicePods ))
271
271
}
272
272
result [i ].Host = hostPriority .Host
273
- result [i ].Score = int (fScore )
273
+ result [i ].Score = int64 (fScore )
274
274
}
275
275
276
276
return nil
0 commit comments