@@ -345,10 +345,19 @@ func VerifyPodContainersCgroupValues(ctx context.Context, f *framework.Framework
345
345
}
346
346
347
347
if expectedMemLimitString != "0" {
348
- errs = append (errs , e2epod .VerifyCgroupValue (f , pod , ci .Name , cgroupMemLimit , expectedMemLimitString ))
348
+ if err := e2epod .VerifyCgroupValue (f , pod , ci .Name , cgroupMemLimit , expectedMemLimitString ); err != nil {
349
+ errs = append (errs , fmt .Errorf ("failed to verify memory limit cgroup value: %w" , err ))
350
+ }
351
+ }
352
+
353
+ if err := e2epod .VerifyCgroupValue (f , pod , ci .Name , cgroupCPULimit , expectedCPULimits ... ); err != nil {
354
+ errs = append (errs , fmt .Errorf ("failed to verify cpu limit cgroup value: %w" , err ))
349
355
}
350
- errs = append (errs , e2epod .VerifyCgroupValue (f , pod , ci .Name , cgroupCPULimit , expectedCPULimits ... ))
351
- errs = append (errs , e2epod .VerifyCgroupValue (f , pod , ci .Name , cgroupCPURequest , strconv .FormatInt (expectedCPUShares , 10 )))
356
+
357
+ if err := e2epod .VerifyCgroupValue (f , pod , ci .Name , cgroupCPURequest , strconv .FormatInt (expectedCPUShares , 10 )); err != nil {
358
+ errs = append (errs , fmt .Errorf ("failed to verify cpu request cgroup value: %w" , err ))
359
+ }
360
+
352
361
// TODO(vinaykul,InPlacePodVerticalScaling): Verify oom_score_adj when runc adds support for updating it
353
362
// See https://github.com/opencontainers/runc/pull/4669
354
363
}
@@ -384,8 +393,7 @@ func verifyContainerRestarts(f *framework.Framework, pod *v1.Pod, gotStatuses []
384
393
if gotStatus .RestartCount != wantStatuses [i ].RestartCount {
385
394
errs = append (errs , fmt .Errorf ("unexpected number of restarts for container %s: got %d, want %d" , gotStatus .Name , gotStatus .RestartCount , wantStatuses [i ].RestartCount ))
386
395
} else if gotStatus .RestartCount > 0 {
387
- err := verifyOomScoreAdj (f , pod , gotStatus .Name )
388
- if err != nil {
396
+ if err := verifyOomScoreAdj (f , pod , gotStatus .Name ); err != nil {
389
397
errs = append (errs , err )
390
398
}
391
399
}
0 commit comments