Skip to content

Commit 03431a4

Browse files
committed
[launcher] Rename CPULimits to CPUDMIPSLimits in service quota
Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
1 parent 48a67fe commit 03431a4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

launcher/launcher_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,11 @@ func TestRuntimeSpec(t *testing.T) {
618618
Hostname: newString("testHostName"),
619619
Sysctl: map[string]string{"key1": "val1", "key2": "val2", "key3": "val3"},
620620
Quotas: aostypes.ServiceQuotas{
621-
CPULimit: newUint64(2000),
622-
RAMLimit: newUint64(1024),
623-
PIDsLimit: newUint64(10),
624-
NoFileLimit: newUint64(3),
625-
TmpLimit: newUint64(512),
621+
CPUDMIPSLimit: newUint64(2000),
622+
RAMLimit: newUint64(1024),
623+
PIDsLimit: newUint64(10),
624+
NoFileLimit: newUint64(3),
625+
TmpLimit: newUint64(512),
626626
},
627627
Devices: []aostypes.ServiceDevice{
628628
{Name: "input", Permissions: "r"},
@@ -822,7 +822,7 @@ func TestRuntimeSpec(t *testing.T) {
822822
t.Errorf("Wrong CPU period value: %d", *runtimeSpec.Linux.Resources.CPU.Period)
823823
}
824824

825-
if *runtimeSpec.Linux.Resources.CPU.Quota != int64(*serviceConfig.Quotas.CPULimit*
825+
if *runtimeSpec.Linux.Resources.CPU.Quota != int64(*serviceConfig.Quotas.CPUDMIPSLimit*
826826
(*runtimeSpec.Linux.Resources.CPU.Period)*uint64(runtime.NumCPU())/nodeInfoProvider.nodeInfo.MaxDMIPs) {
827827
t.Errorf("Wrong CPU quota value: %d", *runtimeSpec.Linux.Resources.CPU.Quota)
828828
}
@@ -994,7 +994,7 @@ func TestMinCPUQuota(t *testing.T) {
994994
ServiceInfo: aostypes.ServiceInfo{ServiceID: "service0"},
995995
serviceConfig: &aostypes.ServiceConfig{
996996
Quotas: aostypes.ServiceQuotas{
997-
CPULimit: newUint64(42),
997+
CPUDMIPSLimit: newUint64(42),
998998
},
999999
},
10001000
},

launcher/spec.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ func (spec *runtimeSpec) applyServiceConfig(config *aostypes.ServiceConfig) erro
136136

137137
spec.ociSpec.Linux.Sysctl = config.Sysctl
138138

139-
if config.Quotas.CPULimit != nil {
140-
spec.setCPULimit(*config.Quotas.CPULimit)
139+
if config.Quotas.CPUDMIPSLimit != nil {
140+
spec.setCPULimit(*config.Quotas.CPUDMIPSLimit)
141141
}
142142

143143
if config.Quotas.RAMLimit != nil {

0 commit comments

Comments
 (0)