mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
fix test cases for cpu shares
This commit is contained in:
committed by
shaowei.wayne
parent
4c87589300
commit
0b6d27002f
@@ -142,9 +142,9 @@ func (m *kubeGenericRuntimeManager) calculateLinuxResources(cpuRequest, cpuLimit
|
||||
// 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
|
||||
// for containers running on existing Kubernetes clusters.
|
||||
if cpuRequest == nil && !cpuLimit.IsZero() {
|
||||
if cpuRequest == nil {
|
||||
cpuShares = int64(cm.MilliCPUToShares(cpuLimit.MilliValue()))
|
||||
} else if cpuRequest != nil {
|
||||
} else {
|
||||
// if cpuRequest.Amount is nil, then MilliCPUToShares will return the minimal number
|
||||
// of CPU shares.
|
||||
cpuShares = int64(cm.MilliCPUToShares(cpuRequest.MilliValue()))
|
||||
|
||||
Reference in New Issue
Block a user