Skip to content

Commit

Permalink
Correctly expose OOM disable state for a server
Browse files Browse the repository at this point in the history
  • Loading branch information
DaneEveritt committed Sep 14, 2021
1 parent f5a1ce1 commit 5fdb0a5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
## v1.6.1
### Fixed
* Fixes server build modifications not being properly persisted to the database when edited.

* Correctly exposes the `oom_disabled` field in the `build` limits block for a server build so that Wings can pick it up.
*
## v1.6.0
### Fixed
* Fixes array merging logic for server transfers that would cause a 500 error to occur in some scenarios.
Expand Down
4 changes: 4 additions & 0 deletions app/Services/Servers/ServerConfigurationStructureService.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ protected function returnCurrentFormat(Server $server): array
'cpu_limit' => $server->cpu,
'threads' => $server->threads,
'disk_space' => $server->disk,
'oom_disabled' => $server->oom_disabled,
],
'container' => [
'image' => $server->image,
// This field is deprecated — use the value in the "build" block.
//
// TODO: remove this key in V2.
'oom_disabled' => $server->oom_disabled,
'requires_rebuild' => false,
],
Expand Down
1 change: 1 addition & 0 deletions app/Transformers/Api/Application/ServerTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function transform(Server $server): array
'io' => $server->io,
'cpu' => $server->cpu,
'threads' => $server->threads,
'oom_disabled' => $server->oom_disabled,
],
'feature_limits' => [
'databases' => $server->database_limit,
Expand Down
2 changes: 2 additions & 0 deletions app/Transformers/Api/Client/ServerTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public function transform(Server $server): array
'disk' => $server->disk,
'io' => $server->io,
'cpu' => $server->cpu,
'threads' => $server->threads,
'oom_disabled' => $server->oom_disabled,
],
'invocation' => $service->handle($server, !$this->getUser()->can(Permission::ACTION_STARTUP_READ, $server)),
'docker_image' => $server->image,
Expand Down

0 comments on commit 5fdb0a5

Please sign in to comment.