mirror of https://github.com/k3s-io/k3s
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 readablepull/6/head
commit
06b6fb5729
|
@ -328,10 +328,8 @@ func (cm *containerManagerImpl) setupNode() error {
|
||||||
if cm.ContainerRuntime == "docker" {
|
if cm.ContainerRuntime == "docker" {
|
||||||
if cm.RuntimeCgroupsName != "" {
|
if cm.RuntimeCgroupsName != "" {
|
||||||
cont := newSystemCgroups(cm.RuntimeCgroupsName)
|
cont := newSystemCgroups(cm.RuntimeCgroupsName)
|
||||||
info, err := cm.cadvisorInterface.MachineInfo()
|
|
||||||
var capacity = api.ResourceList{}
|
var capacity = api.ResourceList{}
|
||||||
if err != nil {
|
if info, err := cm.cadvisorInterface.MachineInfo(); err == nil {
|
||||||
} else {
|
|
||||||
capacity = cadvisor.CapacityFromMachineInfo(info)
|
capacity = cadvisor.CapacityFromMachineInfo(info)
|
||||||
}
|
}
|
||||||
memoryLimit := (int64(capacity.Memory().Value() * DockerMemoryLimitThresholdPercent / 100))
|
memoryLimit := (int64(capacity.Memory().Value() * DockerMemoryLimitThresholdPercent / 100))
|
||||||
|
|
Loading…
Reference in New Issue