From 1b48203f179e2e469d0fb1963dba0b2376f53eb0 Mon Sep 17 00:00:00 2001 From: Darren Stahl Date: Tue, 4 Oct 2016 14:11:32 -0700 Subject: [PATCH] Windows: fix rounding error in container resources Signed-off-by: Darren Stahl --- libcontainerd/client_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainerd/client_windows.go b/libcontainerd/client_windows.go index 86dd9c60de..1ef9967c80 100644 --- a/libcontainerd/client_windows.go +++ b/libcontainerd/client_windows.go @@ -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 {