File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,16 @@ import (
77
88 "github.com/Microsoft/hcsshim/internal/hcs/resourcepaths"
99 hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2"
10+ "github.com/Microsoft/hcsshim/osversion"
11+ "github.com/containerd/errdefs"
1012)
1113
1214// UpdateCPULimits updates the CPU limits of the utility vm
1315func (uvm * UtilityVM ) UpdateCPULimits (ctx context.Context , limits * hcsschema.ProcessorLimits ) error {
16+ // Support for updating CPU limits was not added until 20H2 build
17+ if osversion .Get ().Build < osversion .V20H2 {
18+ return errdefs .ErrNotImplemented
19+ }
1420 req := & hcsschema.ModifySettingRequest {
1521 ResourcePath : resourcepaths .CPULimitsResourcePath ,
1622 Settings : limits ,
Original file line number Diff line number Diff line change @@ -10,9 +10,11 @@ import (
1010 "testing"
1111
1212 "github.com/Microsoft/hcsshim/internal/memory"
13+ "github.com/Microsoft/hcsshim/osversion"
1314 "github.com/Microsoft/hcsshim/pkg/annotations"
1415 "github.com/Microsoft/hcsshim/test/pkg/definitions/cpugroup"
1516 "github.com/Microsoft/hcsshim/test/pkg/definitions/processorinfo"
17+ "github.com/Microsoft/hcsshim/test/pkg/require"
1618 runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
1719)
1820
@@ -132,6 +134,7 @@ func Test_Pod_UpdateResources_Memory_PA(t *testing.T) {
132134
133135func Test_Pod_UpdateResources_CPUShares (t * testing.T ) {
134136 requireAnyFeature (t , featureWCOWHypervisor )
137+ require .Build (t , osversion .V20H2 )
135138
136139 type config struct {
137140 name string
You can’t perform that action at this time.
0 commit comments