mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
Merge pull request #11682 from nak3/priorities-fix
Remove unused argument from fractionOfCapacity()
This commit is contained in:
commit
d30704af87
@ -212,8 +212,8 @@ func calculateBalancedResourceAllocation(pod *api.Pod, node api.Node, pods []*ap
|
|||||||
capacityMilliCPU := node.Status.Capacity.Cpu().MilliValue()
|
capacityMilliCPU := node.Status.Capacity.Cpu().MilliValue()
|
||||||
capacityMemory := node.Status.Capacity.Memory().Value()
|
capacityMemory := node.Status.Capacity.Memory().Value()
|
||||||
|
|
||||||
cpuFraction := fractionOfCapacity(totalMilliCPU, capacityMilliCPU, node.Name)
|
cpuFraction := fractionOfCapacity(totalMilliCPU, capacityMilliCPU)
|
||||||
memoryFraction := fractionOfCapacity(totalMemory, capacityMemory, node.Name)
|
memoryFraction := fractionOfCapacity(totalMemory, capacityMemory)
|
||||||
if cpuFraction >= 1 || memoryFraction >= 1 {
|
if cpuFraction >= 1 || memoryFraction >= 1 {
|
||||||
// if requested >= capacity, the corresponding host should never be preferrred.
|
// if requested >= capacity, the corresponding host should never be preferrred.
|
||||||
score = 0
|
score = 0
|
||||||
@ -239,7 +239,7 @@ func calculateBalancedResourceAllocation(pod *api.Pod, node api.Node, pods []*ap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func fractionOfCapacity(requested, capacity int64, node string) float64 {
|
func fractionOfCapacity(requested, capacity int64) float64 {
|
||||||
if capacity == 0 {
|
if capacity == 0 {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user