Skip to content

Commit

Permalink
Fix HostConfig.DeviceRequests.{list}.Options type error trying to cre…
Browse files Browse the repository at this point in the history
…ate a container (take 2)
  • Loading branch information
austinwbest committed Aug 22, 2024
1 parent b5a5cd1 commit 64ecee0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions root/app/www/public/classes/traits/Docker/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ public function apiCreateContainer($inspect = [])
}
}

if (empty($payload['HostConfig']['DeviceRequests']['Options'])) {
$payload['HostConfig']['DeviceRequests']['Options'] = new StdClass();
if (!empty($payload['HostConfig']['DeviceRequests'])) {
foreach ($payload['HostConfig']['DeviceRequests'] as $deviceRequestIndex => $deviceRequest) {
if (empty($payload['HostConfig']['DeviceRequests'][$deviceRequestIndex]['Options'])) {
$payload['HostConfig']['DeviceRequests'][$deviceRequestIndex]['Options'] = new StdClass();
}
}
}

if (empty($payload['ExposedPorts'])) {
Expand Down

0 comments on commit 64ecee0

Please sign in to comment.