Merge pull request #42152 from AkihiroSuda/fix-rootless-info-42151

info: unset cgroup-related fields when CgroupDriver == none
This commit is contained in:
Tianon Gravi 2021-11-08 14:45:11 -08:00 committed by GitHub
commit 65cc84abc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 10 deletions

View File

@ -25,16 +25,18 @@ func (daemon *Daemon) fillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo)
v.CgroupVersion = "2" v.CgroupVersion = "2"
} }
v.MemoryLimit = sysInfo.MemoryLimit if v.CgroupDriver != cgroupNoneDriver {
v.SwapLimit = sysInfo.SwapLimit v.MemoryLimit = sysInfo.MemoryLimit
v.KernelMemory = sysInfo.KernelMemory v.SwapLimit = sysInfo.SwapLimit
v.KernelMemoryTCP = sysInfo.KernelMemoryTCP v.KernelMemory = sysInfo.KernelMemory
v.OomKillDisable = sysInfo.OomKillDisable v.KernelMemoryTCP = sysInfo.KernelMemoryTCP
v.CPUCfsPeriod = sysInfo.CPUCfs v.OomKillDisable = sysInfo.OomKillDisable
v.CPUCfsQuota = sysInfo.CPUCfs v.CPUCfsPeriod = sysInfo.CPUCfs
v.CPUShares = sysInfo.CPUShares v.CPUCfsQuota = sysInfo.CPUCfs
v.CPUSet = sysInfo.Cpuset v.CPUShares = sysInfo.CPUShares
v.PidsLimit = sysInfo.PidsLimit v.CPUSet = sysInfo.Cpuset
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()