Merge pull request #101467 from ingvagabund/noderesources-replace-IsScalerResourceName-with-nodeinfo-allocatable-scalar-resource-presence

noderesource: node info already knows which resources are scalar
This commit is contained in:
Kubernetes Prow Robot 2021-04-28 18:12:50 -07:00 committed by GitHub
commit b4ea4322a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,7 +99,7 @@ func calculateResourceAllocatableRequest(nodeInfo *framework.NodeInfo, pod *v1.P
case v1.ResourceEphemeralStorage:
return nodeInfo.Allocatable.EphemeralStorage, (nodeInfo.Requested.EphemeralStorage + podRequest)
default:
if schedutil.IsScalarResourceName(resource) {
if _, exists := nodeInfo.Allocatable.ScalarResources[resource]; exists {
return nodeInfo.Allocatable.ScalarResources[resource], (nodeInfo.Requested.ScalarResources[resource] + podRequest)
}
}