mirror of
https://github.com/docker/docs.git
synced 2026-04-12 06:19:22 +07:00
Lint fixes on runconfig
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
@@ -109,14 +109,14 @@ func allocateDaemonPort(addr string) error {
|
||||
|
||||
func adjustCpuShares(version version.Version, hostConfig *runconfig.HostConfig) {
|
||||
if version.LessThan("1.19") {
|
||||
if hostConfig != nil && hostConfig.CpuShares > 0 {
|
||||
if hostConfig != nil && hostConfig.CPUShares > 0 {
|
||||
// Handle unsupported CpuShares
|
||||
if hostConfig.CpuShares < linuxMinCpuShares {
|
||||
logrus.Warnf("Changing requested CpuShares of %d to minimum allowed of %d", hostConfig.CpuShares, linuxMinCpuShares)
|
||||
hostConfig.CpuShares = linuxMinCpuShares
|
||||
} else if hostConfig.CpuShares > linuxMaxCpuShares {
|
||||
logrus.Warnf("Changing requested CpuShares of %d to maximum allowed of %d", hostConfig.CpuShares, linuxMaxCpuShares)
|
||||
hostConfig.CpuShares = linuxMaxCpuShares
|
||||
if hostConfig.CPUShares < linuxMinCpuShares {
|
||||
logrus.Warnf("Changing requested CpuShares of %d to minimum allowed of %d", hostConfig.CPUShares, linuxMinCpuShares)
|
||||
hostConfig.CPUShares = linuxMinCpuShares
|
||||
} else if hostConfig.CPUShares > linuxMaxCpuShares {
|
||||
logrus.Warnf("Changing requested CpuShares of %d to maximum allowed of %d", hostConfig.CPUShares, linuxMaxCpuShares)
|
||||
hostConfig.CPUShares = linuxMaxCpuShares
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user