Commit 3deab69d authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #53790 from yanxuean/cgroupredundancy

Automatic merge from submit-queue (batch tested with PRs 52959, 53790). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. remove redundancy code in setCPUCgroupConfig fix #53925 Signed-off-by: 's avataryanxuean <yan.xuean@zte.com.cn> **What this PR does / why we need it**: The check of burstableCPUShares is redundancy. We have done it in MilliCPUToShares. It is responsibility of MilliCPUToShares. ``` func (m *qosContainerManagerImpl) setCPUCgroupConfig(configs map[v1.PodQOSClass]*CgroupConfig) error { ........ // set burstable shares based on current observe state burstableCPUShares := MilliCPUToShares(burstablePodCPURequest) if burstableCPUShares < uint64(MinShares) { burstableCPUShares = uint64(MinShares) } ``` **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # Improveing code. **Special notes for your reviewer**: **Release note**: ```release-note ```
parents 2e6ccc3f 8adb2181
...@@ -194,9 +194,6 @@ func (m *qosContainerManagerImpl) setCPUCgroupConfig(configs map[v1.PodQOSClass] ...@@ -194,9 +194,6 @@ func (m *qosContainerManagerImpl) setCPUCgroupConfig(configs map[v1.PodQOSClass]
// set burstable shares based on current observe state // set burstable shares based on current observe state
burstableCPUShares := MilliCPUToShares(burstablePodCPURequest) burstableCPUShares := MilliCPUToShares(burstablePodCPURequest)
if burstableCPUShares < uint64(MinShares) {
burstableCPUShares = uint64(MinShares)
}
configs[v1.PodQOSBurstable].ResourceParameters.CpuShares = &burstableCPUShares configs[v1.PodQOSBurstable].ResourceParameters.CpuShares = &burstableCPUShares
return nil return nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment