mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Lint fixes on runconfig
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
0852170e8c
commit
5170a2c096
17 changed files with 245 additions and 144 deletions
|
@ -185,15 +185,15 @@ func (daemon *Daemon) verifyContainerSettings(hostConfig *runconfig.HostConfig,
|
|||
if hostConfig.MemorySwappiness != -1 && (hostConfig.MemorySwappiness < 0 || hostConfig.MemorySwappiness > 100) {
|
||||
return warnings, fmt.Errorf("Invalid value: %d, valid memory swappiness range is 0-100.", hostConfig.MemorySwappiness)
|
||||
}
|
||||
if hostConfig.CpuPeriod > 0 && !daemon.SystemConfig().CpuCfsPeriod {
|
||||
if hostConfig.CPUPeriod > 0 && !daemon.SystemConfig().CpuCfsPeriod {
|
||||
warnings = append(warnings, "Your kernel does not support CPU cfs period. Period discarded.")
|
||||
logrus.Warnf("Your kernel does not support CPU cfs period. Period discarded.")
|
||||
hostConfig.CpuPeriod = 0
|
||||
hostConfig.CPUPeriod = 0
|
||||
}
|
||||
if hostConfig.CpuQuota > 0 && !daemon.SystemConfig().CpuCfsQuota {
|
||||
if hostConfig.CPUQuota > 0 && !daemon.SystemConfig().CpuCfsQuota {
|
||||
warnings = append(warnings, "Your kernel does not support CPU cfs quota. Quota discarded.")
|
||||
logrus.Warnf("Your kernel does not support CPU cfs quota. Quota discarded.")
|
||||
hostConfig.CpuQuota = 0
|
||||
hostConfig.CPUQuota = 0
|
||||
}
|
||||
if hostConfig.BlkioWeight > 0 && (hostConfig.BlkioWeight < 10 || hostConfig.BlkioWeight > 1000) {
|
||||
return warnings, fmt.Errorf("Range of blkio weight is from 10 to 1000.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue