Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 039e967

Browse files
committed
info: unset cgroup-related fields when CgroupDriver == none
Fix issue 42151 Signed-off-by: Akihiro Suda <[email protected]>
1 parent 4735a0c commit 039e967

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

daemon/info_unix.go

+12-10
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,18 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
2525
v.CgroupVersion = "2"
2626
}
2727

28-
v.MemoryLimit = sysInfo.MemoryLimit
29-
v.SwapLimit = sysInfo.SwapLimit
30-
v.KernelMemory = sysInfo.KernelMemory
31-
v.KernelMemoryTCP = sysInfo.KernelMemoryTCP
32-
v.OomKillDisable = sysInfo.OomKillDisable
33-
v.CPUCfsPeriod = sysInfo.CPUCfs
34-
v.CPUCfsQuota = sysInfo.CPUCfs
35-
v.CPUShares = sysInfo.CPUShares
36-
v.CPUSet = sysInfo.Cpuset
37-
v.PidsLimit = sysInfo.PidsLimit
28+
if v.CgroupDriver != cgroupNoneDriver {
29+
v.MemoryLimit = sysInfo.MemoryLimit
30+
v.SwapLimit = sysInfo.SwapLimit
31+
v.KernelMemory = sysInfo.KernelMemory
32+
v.KernelMemoryTCP = sysInfo.KernelMemoryTCP
33+
v.OomKillDisable = sysInfo.OomKillDisable
34+
v.CPUCfsPeriod = sysInfo.CPUCfs
35+
v.CPUCfsQuota = sysInfo.CPUCfs
36+
v.CPUShares = sysInfo.CPUShares
37+
v.CPUSet = sysInfo.Cpuset
38+
v.PidsLimit = sysInfo.PidsLimit
39+
}
3840
v.Runtimes = daemon.configStore.GetAllRuntimes()
3941
v.DefaultRuntime = daemon.configStore.GetDefaultRuntimeName()
4042
v.InitBinary = daemon.configStore.GetInitPath()

0 commit comments

Comments
 (0)