зеркало из https://github.com/microsoft/docker.git
Windows: fix rounding error in container resources
Signed-off-by: Darren Stahl <darst@microsoft.com>
This commit is contained in:
Родитель
0cc7f0185f
Коммит
1b48203f17
|
@ -113,12 +113,12 @@ func (clnt *client) Create(containerID string, checkpoint string, checkpointDir
|
|||
configuration.ProcessorWeight = uint64(*spec.Windows.Resources.CPU.Shares)
|
||||
}
|
||||
if spec.Windows.Resources.CPU.Percent != nil {
|
||||
configuration.ProcessorMaximum = int64(*spec.Windows.Resources.CPU.Percent * 100) // ProcessorMaximum is a value between 1 and 10000
|
||||
configuration.ProcessorMaximum = int64(*spec.Windows.Resources.CPU.Percent) * 100 // ProcessorMaximum is a value between 1 and 10000
|
||||
}
|
||||
}
|
||||
if spec.Windows.Resources.Memory != nil {
|
||||
if spec.Windows.Resources.Memory.Limit != nil {
|
||||
configuration.MemoryMaximumInMB = int64(*spec.Windows.Resources.Memory.Limit / 1024 / 1024)
|
||||
configuration.MemoryMaximumInMB = int64(*spec.Windows.Resources.Memory.Limit) / 1024 / 1024
|
||||
}
|
||||
}
|
||||
if spec.Windows.Resources.Storage != nil {
|
||||
|
|
Загрузка…
Ссылка в новой задаче