Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed pod's cpu & mem resource setters helpers. (#608)
The original implementation was overwriting any req/limit that was previosly set for the other resources. For instance, test cases doing this didn't work properly: pod.RedefineWithCPUResources(testPod, "1", "1") pod.RedefineWithMemoryResources(testPod, "512Mi", "512Mi") The call to pod.RedefineWithMemoryResources() was zero-ing the cpu req/limits that was just set before ("1", "1") as it was creating a new empty container.Resources field (corev1.ResourceRequirements{}). The new implementations don't overwrite other reqs/limits values, it justs sets/overwrite the corresponding ones (cpu/mem). The affected test cases were passing until now because a bug in the cert suite code in the function AreCPUResourcesWholeUnits() that was wrongly returning "true" when the cpu reqs/limit were not set. It was fixed here: redhat-best-practices-for-k8s/certsuite#1631
- Loading branch information