Adds Windows resource limits support

This will allow running Windows Containers to have their resource
limits updated through containerd. The CPU resource limits support
has been added for Windows Server 20H2 and newer, on older versions
hcsshim will raise an Unimplemented error.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
This commit is contained in:
Claudiu Belu
2021-07-21 19:41:59 -07:00
parent 5b29542cbe
commit 2bc77b8a28
10 changed files with 233 additions and 159 deletions

View File

@@ -67,7 +67,7 @@ func TestUpdateContainerResources(t *testing.T) {
t.Log("Update container memory limit after created")
err = runtimeService.UpdateContainerResources(cn, &runtime.LinuxContainerResources{
MemoryLimitInBytes: 400 * 1024 * 1024,
})
}, nil)
require.NoError(t, err)
t.Log("Check memory limit in container OCI spec")
@@ -90,7 +90,7 @@ func TestUpdateContainerResources(t *testing.T) {
t.Log("Update container memory limit after started")
err = runtimeService.UpdateContainerResources(cn, &runtime.LinuxContainerResources{
MemoryLimitInBytes: 800 * 1024 * 1024,
})
}, nil)
require.NoError(t, err)
t.Log("Check memory limit in container OCI spec")