fix: rename
This commit is contained in:
@@ -307,8 +307,8 @@ func (m *cgroupManagerImpl) Destroy(cgroupConfig *CgroupConfig) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// getCpuWeight converts from the range [2, 262144] to [1, 10000]
|
||||
func getCpuWeight(cpuShares *uint64) uint64 {
|
||||
// getCPUWeight converts from the range [2, 262144] to [1, 10000]
|
||||
func getCPUWeight(cpuShares *uint64) uint64 {
|
||||
if cpuShares == nil {
|
||||
return 0
|
||||
}
|
||||
@@ -360,18 +360,18 @@ func (m *cgroupManagerImpl) toResources(resourceConfig *ResourceConfig) *libcont
|
||||
if resourceConfig.Memory != nil {
|
||||
resources.Memory = *resourceConfig.Memory
|
||||
}
|
||||
if resourceConfig.CpuShares != nil {
|
||||
if resourceConfig.CPUShares != nil {
|
||||
if libcontainercgroups.IsCgroup2UnifiedMode() {
|
||||
resources.CpuWeight = getCpuWeight(resourceConfig.CpuShares)
|
||||
resources.CpuWeight = getCPUWeight(resourceConfig.CPUShares)
|
||||
} else {
|
||||
resources.CpuShares = *resourceConfig.CpuShares
|
||||
resources.CpuShares = *resourceConfig.CPUShares
|
||||
}
|
||||
}
|
||||
if resourceConfig.CpuQuota != nil {
|
||||
resources.CpuQuota = *resourceConfig.CpuQuota
|
||||
if resourceConfig.CPUQuota != nil {
|
||||
resources.CpuQuota = *resourceConfig.CPUQuota
|
||||
}
|
||||
if resourceConfig.CpuPeriod != nil {
|
||||
resources.CpuPeriod = *resourceConfig.CpuPeriod
|
||||
if resourceConfig.CPUPeriod != nil {
|
||||
resources.CpuPeriod = *resourceConfig.CPUPeriod
|
||||
}
|
||||
if resourceConfig.PidsLimit != nil {
|
||||
resources.PidsLimit = *resourceConfig.PidsLimit
|
||||
@@ -531,7 +531,7 @@ func (m *cgroupManagerImpl) ReduceCPULimits(cgroupName CgroupName) error {
|
||||
// Set lowest possible CpuShares value for the cgroup
|
||||
minimumCPUShares := uint64(MinShares)
|
||||
resources := &ResourceConfig{
|
||||
CpuShares: &minimumCPUShares,
|
||||
CPUShares: &minimumCPUShares,
|
||||
}
|
||||
containerConfig := &CgroupConfig{
|
||||
Name: cgroupName,
|
||||
|
Reference in New Issue
Block a user