mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-31 16:36:38 +00:00
Merge pull request #7273 from openanolis/runtime-rs-fix-mem-ci
bugfix: plus default_memory when calculating mem size
This commit is contained in:
@@ -105,7 +105,12 @@ impl InitialSizeManager {
|
||||
hv.cpu_info.default_vcpus = self.resource.vcpu as i32
|
||||
}
|
||||
if self.resource.mem_mb > 0 {
|
||||
hv.memory_info.default_memory = self.resource.mem_mb;
|
||||
// since the memory overhead introduced by kata-agent and system components
|
||||
// will really affect the amount of memory the user can use, so we choose to
|
||||
// plus the default_memory here, instead of overriding it.
|
||||
// (if we override the default_memory here, and user apllications still
|
||||
// use memory as they orignally expected, it would be easy to OOM.)
|
||||
hv.memory_info.default_memory += self.resource.mem_mb;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@@ -9,15 +9,11 @@ load "${BATS_TEST_DIRNAME}/../../common.bash"
|
||||
load "${BATS_TEST_DIRNAME}/tests_common.sh"
|
||||
|
||||
setup() {
|
||||
[ "${KATA_HYPERVISOR}" == "dragonball" ] && skip "Test is currently failing, see: https://github.com/kata-containers/kata-containers/issues/7271"
|
||||
|
||||
pod_name="pod-oom"
|
||||
get_pod_config_dir
|
||||
}
|
||||
|
||||
@test "Test OOM events for pods" {
|
||||
[ "${KATA_HYPERVISOR}" == "dragonball" ] && skip "Test is currently failing, see: https://github.com/kata-containers/kata-containers/issues/7271"
|
||||
|
||||
# Create pod
|
||||
kubectl create -f "${pod_config_dir}/$pod_name.yaml"
|
||||
|
||||
@@ -33,8 +29,6 @@ setup() {
|
||||
}
|
||||
|
||||
teardown() {
|
||||
[ "${KATA_HYPERVISOR}" == "dragonball" ] && skip "Test is currently failing, see: https://github.com/kata-containers/kata-containers/issues/7271"
|
||||
|
||||
# Debugging information
|
||||
kubectl describe "pod/$pod_name"
|
||||
kubectl get "pod/$pod_name" -o yaml
|
||||
|
Reference in New Issue
Block a user