mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #96774 from lixiaobing1/noderesources2
clarify the logic of noderesources comparison
This commit is contained in:
commit
f367cb671a
@ -248,7 +248,7 @@ func fitsRequest(podRequest *preFilterState, nodeInfo *framework.NodeInfo, ignor
|
|||||||
return insufficientResources
|
return insufficientResources
|
||||||
}
|
}
|
||||||
|
|
||||||
if nodeInfo.Allocatable.MilliCPU < podRequest.MilliCPU+nodeInfo.Requested.MilliCPU {
|
if podRequest.MilliCPU > (nodeInfo.Allocatable.MilliCPU - nodeInfo.Requested.MilliCPU) {
|
||||||
insufficientResources = append(insufficientResources, InsufficientResource{
|
insufficientResources = append(insufficientResources, InsufficientResource{
|
||||||
v1.ResourceCPU,
|
v1.ResourceCPU,
|
||||||
"Insufficient cpu",
|
"Insufficient cpu",
|
||||||
@ -257,7 +257,7 @@ func fitsRequest(podRequest *preFilterState, nodeInfo *framework.NodeInfo, ignor
|
|||||||
nodeInfo.Allocatable.MilliCPU,
|
nodeInfo.Allocatable.MilliCPU,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if nodeInfo.Allocatable.Memory < podRequest.Memory+nodeInfo.Requested.Memory {
|
if podRequest.Memory > (nodeInfo.Allocatable.Memory - nodeInfo.Requested.Memory) {
|
||||||
insufficientResources = append(insufficientResources, InsufficientResource{
|
insufficientResources = append(insufficientResources, InsufficientResource{
|
||||||
v1.ResourceMemory,
|
v1.ResourceMemory,
|
||||||
"Insufficient memory",
|
"Insufficient memory",
|
||||||
@ -266,7 +266,7 @@ func fitsRequest(podRequest *preFilterState, nodeInfo *framework.NodeInfo, ignor
|
|||||||
nodeInfo.Allocatable.Memory,
|
nodeInfo.Allocatable.Memory,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if nodeInfo.Allocatable.EphemeralStorage < podRequest.EphemeralStorage+nodeInfo.Requested.EphemeralStorage {
|
if podRequest.EphemeralStorage > (nodeInfo.Allocatable.EphemeralStorage - nodeInfo.Requested.EphemeralStorage) {
|
||||||
insufficientResources = append(insufficientResources, InsufficientResource{
|
insufficientResources = append(insufficientResources, InsufficientResource{
|
||||||
v1.ResourceEphemeralStorage,
|
v1.ResourceEphemeralStorage,
|
||||||
"Insufficient ephemeral-storage",
|
"Insufficient ephemeral-storage",
|
||||||
@ -288,7 +288,7 @@ func fitsRequest(podRequest *preFilterState, nodeInfo *framework.NodeInfo, ignor
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if nodeInfo.Allocatable.ScalarResources[rName] < rQuant+nodeInfo.Requested.ScalarResources[rName] {
|
if rQuant > (nodeInfo.Allocatable.ScalarResources[rName] - nodeInfo.Requested.ScalarResources[rName]) {
|
||||||
insufficientResources = append(insufficientResources, InsufficientResource{
|
insufficientResources = append(insufficientResources, InsufficientResource{
|
||||||
rName,
|
rName,
|
||||||
fmt.Sprintf("Insufficient %v", rName),
|
fmt.Sprintf("Insufficient %v", rName),
|
||||||
|
Loading…
Reference in New Issue
Block a user