Merge pull request #2248 from nextcloud/enh/noid/shm-size-int

shm-size must be an int
This commit is contained in:
Simon L 2023-03-31 11:45:22 +02:00 committed by GitHub
commit 291d543f37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -25,7 +25,7 @@ class Container {
private array $devices;
/** @var string[] */
private array $capAdd;
private string $shmSize;
private int $shmSize;
private DockerActionManager $dockerActionManager;
public function __construct(
@ -42,7 +42,7 @@ class Container {
array $secrets,
array $devices,
array $capAdd,
string $shmSize,
int $shmSize,
DockerActionManager $dockerActionManager
) {
$this->identifier = $identifier;
@ -78,7 +78,7 @@ class Container {
return $this->restartPolicy;
}
public function GetShmSize() : string {
public function GetShmSize() : int {
return $this->shmSize;
}

View file

@ -218,7 +218,7 @@ class ContainerDefinitionFetcher
$capAdd = $entry['cap_add'];
}
$shmSize = '';
$shmSize = -1;
if (isset($entry['shm_size'])) {
$shmSize = $entry['shm_size'];
}

View file

@ -406,7 +406,7 @@ class DockerActionManager
}
$shmSize = $container->GetShmSize();
if ($shmSize !== '') {
if ($shmSize > 0) {
$requestBody['HostConfig']['ShmSize'] = $shmSize;
}