backwards compatibility

This commit is contained in:
Boy132 2024-05-08 11:52:28 +02:00
parent 92d167eb10
commit 5aa7128b9c
2 changed files with 8 additions and 0 deletions

View File

@ -40,6 +40,10 @@ class BuildModificationService
throw_unless($existingAllocation, new DisplayException('The requested default allocation is not currently assigned to this server.'));
}
if(!isset($data['oom_killer']) && isset($data['oom_disabled'])) {
$data['oom_killer'] = !$data['oom_disabled'];
}
// If any of these values are passed through in the data array go ahead and set them correctly on the server model.
$merge = Arr::only($data, ['oom_killer', 'memory', 'swap', 'io', 'cpu', 'threads', 'disk', 'allocation_id']);

View File

@ -47,6 +47,10 @@ class ServerCreationService
*/
public function handle(array $data, DeploymentObject $deployment = null): Server
{
if(!isset($data['oom_killer']) && isset($data['oom_disabled'])) {
$data['oom_killer'] = !$data['oom_disabled'];
}
// If a deployment object has been passed we need to get the allocation
// that the server should use, and assign the node from that allocation.
if ($deployment instanceof DeploymentObject) {