mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
keep original cpu limit logic to be in line with the comments
This commit is contained in:
parent
0b6d27002f
commit
51883193c5
@ -142,7 +142,7 @@ func (m *kubeGenericRuntimeManager) calculateLinuxResources(cpuRequest, cpuLimit
|
|||||||
// If request is not specified, but limit is, we want request to default to limit.
|
// If request is not specified, but limit is, we want request to default to limit.
|
||||||
// API server does this for new containers, but we repeat this logic in Kubelet
|
// API server does this for new containers, but we repeat this logic in Kubelet
|
||||||
// for containers running on existing Kubernetes clusters.
|
// for containers running on existing Kubernetes clusters.
|
||||||
if cpuRequest == nil {
|
if cpuRequest == nil && cpuLimit != nil {
|
||||||
cpuShares = int64(cm.MilliCPUToShares(cpuLimit.MilliValue()))
|
cpuShares = int64(cm.MilliCPUToShares(cpuLimit.MilliValue()))
|
||||||
} else {
|
} else {
|
||||||
// if cpuRequest.Amount is nil, then MilliCPUToShares will return the minimal number
|
// if cpuRequest.Amount is nil, then MilliCPUToShares will return the minimal number
|
||||||
|
Loading…
Reference in New Issue
Block a user