Fix null check for memory swappiness and CPU shares

This commit is contained in:
Andras Bacsai 2024-03-13 15:00:29 +01:00
parent 1f03499fc5
commit 3198999746

View File

@ -35,7 +35,7 @@ public function submit()
if (!$this->resource->limits_memory_swap) {
$this->resource->limits_memory_swap = "0";
}
if (!$this->resource->limits_memory_swappiness) {
if (is_null($this->resource->limits_memory_swappiness)) {
$this->resource->limits_memory_swappiness = "60";
}
if (!$this->resource->limits_memory_reservation) {
@ -47,7 +47,7 @@ public function submit()
if ($this->resource->limits_cpuset === "") {
$this->resource->limits_cpuset = null;
}
if (!$this->resource->limits_cpu_shares) {
if (is_null($this->resource->limits_cpu_shares)) {
$this->resource->limits_cpu_shares = 1024;
}
$this->validate();