CCv0: Merge main into CCv0 branch

Merge in snap fix

Signed-off-by: Megan Wright <megan.wright@ibm.com>
This commit is contained in:
Megan Wright
2022-06-16 10:46:27 +01:00
186 changed files with 5760 additions and 1551 deletions

View File

@@ -1119,7 +1119,7 @@ func CalculateSandboxSizing(spec *specs.Spec) (numCPU, memSizeMB uint32) {
// ... to result in VM resources of 1 (MB) for memory, and 3 for CPU (2200 mCPU rounded up to 3).
annotation, ok := spec.Annotations[ctrAnnotations.SandboxCPUPeriod]
if ok {
period, err = strconv.ParseUint(annotation, 10, 32)
period, err = strconv.ParseUint(annotation, 10, 64)
if err != nil {
ociLog.Warningf("sandbox-sizing: failure to parse SandboxCPUPeriod: %s", annotation)
period = 0
@@ -1128,7 +1128,7 @@ func CalculateSandboxSizing(spec *specs.Spec) (numCPU, memSizeMB uint32) {
annotation, ok = spec.Annotations[ctrAnnotations.SandboxCPUQuota]
if ok {
quota, err = strconv.ParseInt(annotation, 10, 32)
quota, err = strconv.ParseInt(annotation, 10, 64)
if err != nil {
ociLog.Warningf("sandbox-sizing: failure to parse SandboxCPUQuota: %s", annotation)
quota = 0
@@ -1137,7 +1137,7 @@ func CalculateSandboxSizing(spec *specs.Spec) (numCPU, memSizeMB uint32) {
annotation, ok = spec.Annotations[ctrAnnotations.SandboxMem]
if ok {
memory, err = strconv.ParseInt(annotation, 10, 32)
memory, err = strconv.ParseInt(annotation, 10, 64)
if err != nil {
ociLog.Warningf("sandbox-sizing: failure to parse SandboxMem: %s", annotation)
memory = 0

View File

@@ -1196,6 +1196,11 @@ func TestCalculateSandboxSizing(t *testing.T) {
expectedCPU: 100,
expectedMem: 0,
},
{
spec: makeSizingAnnotations("4294967296", "400", "100"),
expectedCPU: 4,
expectedMem: 4096,
},
}
for _, tt := range testCases {