Skip to content

Commit 5b33feb

Browse files
authored
Merge pull request kubernetes#95146 from draveness/patch-5
fix: use ">" instead of ">=" in resource allocation
2 parents e67fa02 + 79f05c6 commit 5b33feb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/scheduler/framework/plugins/noderesources/resource_allocation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ func (r *resourceAllocationScorer) score(
6161
var score int64
6262

6363
// Check if the pod has volumes and this could be added to scorer function for balanced resource allocation.
64-
if len(pod.Spec.Volumes) >= 0 && utilfeature.DefaultFeatureGate.Enabled(features.BalanceAttachedNodeVolumes) && nodeInfo.TransientInfo != nil {
64+
if len(pod.Spec.Volumes) > 0 && utilfeature.DefaultFeatureGate.Enabled(features.BalanceAttachedNodeVolumes) && nodeInfo.TransientInfo != nil {
6565
score = r.scorer(requested, allocatable, true, nodeInfo.TransientInfo.TransNodeInfo.RequestedVolumes, nodeInfo.TransientInfo.TransNodeInfo.AllocatableVolumesCount)
6666
} else {
6767
score = r.scorer(requested, allocatable, false, 0, 0)
6868
}
6969
if klog.V(10).Enabled() {
70-
if len(pod.Spec.Volumes) >= 0 && utilfeature.DefaultFeatureGate.Enabled(features.BalanceAttachedNodeVolumes) && nodeInfo.TransientInfo != nil {
70+
if len(pod.Spec.Volumes) > 0 && utilfeature.DefaultFeatureGate.Enabled(features.BalanceAttachedNodeVolumes) && nodeInfo.TransientInfo != nil {
7171
klog.Infof(
7272
"%v -> %v: %v, map of allocatable resources %v, map of requested resources %v , allocatable volumes %d, requested volumes %d, score %d",
7373
pod.Name, node.Name, r.Name,

0 commit comments

Comments
 (0)