1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

info: unset cgroup-related fields when CgroupDriver == none

Fix issue 42151

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2021-03-16 16:17:22 +09:00
parent 4735a0c84f
commit 039e9670cb
No known key found for this signature in database
GPG key ID: 49524C6F9F638F1A

View file

@ -25,6 +25,7 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
v.CgroupVersion = "2" v.CgroupVersion = "2"
} }
if v.CgroupDriver != cgroupNoneDriver {
v.MemoryLimit = sysInfo.MemoryLimit v.MemoryLimit = sysInfo.MemoryLimit
v.SwapLimit = sysInfo.SwapLimit v.SwapLimit = sysInfo.SwapLimit
v.KernelMemory = sysInfo.KernelMemory v.KernelMemory = sysInfo.KernelMemory
@ -35,6 +36,7 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
v.CPUShares = sysInfo.CPUShares v.CPUShares = sysInfo.CPUShares
v.CPUSet = sysInfo.Cpuset v.CPUSet = sysInfo.Cpuset
v.PidsLimit = sysInfo.PidsLimit v.PidsLimit = sysInfo.PidsLimit
}
v.Runtimes = daemon.configStore.GetAllRuntimes() v.Runtimes = daemon.configStore.GetAllRuntimes()
v.DefaultRuntime = daemon.configStore.GetDefaultRuntimeName() v.DefaultRuntime = daemon.configStore.GetDefaultRuntimeName()
v.InitBinary = daemon.configStore.GetInitPath() v.InitBinary = daemon.configStore.GetInitPath()