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:
@@ -111,12 +111,15 @@ func TestTruncIndex(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, cn, cStats.Attributes.Id)
|
||||
|
||||
t.Logf("Update container memory limit after started")
|
||||
if goruntime.GOOS != "windows" {
|
||||
// TODO(claudiub): remove this when UpdateContainerResources works on running Windows Containers.
|
||||
// https://github.com/containerd/containerd/issues/5187
|
||||
t.Logf("Update container memory limit after started")
|
||||
err = runtimeService.UpdateContainerResources(cnTruncIndex, &runtimeapi.LinuxContainerResources{
|
||||
MemoryLimitInBytes: 50 * 1024 * 1024,
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
} else {
|
||||
err = runtimeService.UpdateContainerResources(cnTruncIndex, nil, &runtimeapi.WindowsContainerResources{
|
||||
MemoryLimitInBytes: 50 * 1024 * 1024,
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user