mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #31489 from ZTE-PaaS/zhangke-patch-030
Automatic merge from submit-queue optimize if-else of setupNode of container_manager_linix make the code more readable
This commit is contained in:
commit
06b6fb5729
@ -328,10 +328,8 @@ func (cm *containerManagerImpl) setupNode() error {
|
||||
if cm.ContainerRuntime == "docker" {
|
||||
if cm.RuntimeCgroupsName != "" {
|
||||
cont := newSystemCgroups(cm.RuntimeCgroupsName)
|
||||
info, err := cm.cadvisorInterface.MachineInfo()
|
||||
var capacity = api.ResourceList{}
|
||||
if err != nil {
|
||||
} else {
|
||||
if info, err := cm.cadvisorInterface.MachineInfo(); err == nil {
|
||||
capacity = cadvisor.CapacityFromMachineInfo(info)
|
||||
}
|
||||
memoryLimit := (int64(capacity.Memory().Value() * DockerMemoryLimitThresholdPercent / 100))
|
||||
|
Loading…
Reference in New Issue
Block a user