rename pullContainer to pullImage

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-11-20 13:16:59 +01:00
parent 03aa7a1ce1
commit f935993ac6
2 changed files with 8 additions and 8 deletions

View file

@ -26,11 +26,11 @@ class DockerController
$this->configurationManager = $configurationManager; $this->configurationManager = $configurationManager;
} }
private function PerformRecursiveContainerStart(string $id, bool $pullContainer = true) : void { private function PerformRecursiveContainerStart(string $id, bool $pullImage = true) : void {
$container = $this->containerDefinitionFetcher->GetContainerById($id); $container = $this->containerDefinitionFetcher->GetContainerById($id);
foreach($container->GetDependsOn() as $dependency) { foreach($container->GetDependsOn() as $dependency) {
$this->PerformRecursiveContainerStart($dependency, $pullContainer); $this->PerformRecursiveContainerStart($dependency, $pullImage);
} }
// Don't start if container is already running // Don't start if container is already running
@ -43,15 +43,15 @@ class DockerController
// Skip database image pull if the last shutdown was not clean // Skip database image pull if the last shutdown was not clean
if ($id === 'nextcloud-aio-database') { if ($id === 'nextcloud-aio-database') {
if ($this->dockerActionManager->GetDatabasecontainerExitCode() > 0) { if ($this->dockerActionManager->GetDatabasecontainerExitCode() > 0) {
$pullContainer = false; $pullImage = false;
error_log('Not pulling the latest database image because the container was not correctly shut down.'); error_log('Not pulling the latest database image because the container was not correctly shut down.');
} }
} }
$this->dockerActionManager->DeleteContainer($container); $this->dockerActionManager->DeleteContainer($container);
$this->dockerActionManager->CreateVolumes($container); $this->dockerActionManager->CreateVolumes($container);
if ($pullContainer) { if ($pullImage) {
$this->dockerActionManager->PullContainer($container); $this->dockerActionManager->PullImage($container);
} }
$this->dockerActionManager->CreateContainer($container); $this->dockerActionManager->CreateContainer($container);
$this->dockerActionManager->StartContainer($container); $this->dockerActionManager->StartContainer($container);
@ -188,7 +188,7 @@ class DockerController
return $response->withStatus(201)->withHeader('Location', '/'); return $response->withStatus(201)->withHeader('Location', '/');
} }
public function startTopContainer(bool $pullContainer) : void { public function startTopContainer(bool $pullImage) : void {
$config = $this->configurationManager->GetConfig(); $config = $this->configurationManager->GetConfig();
// set AIO_TOKEN // set AIO_TOKEN
$config['AIO_TOKEN'] = bin2hex(random_bytes(24)); $config['AIO_TOKEN'] = bin2hex(random_bytes(24));
@ -199,7 +199,7 @@ class DockerController
$id = self::TOP_CONTAINER; $id = self::TOP_CONTAINER;
$this->PerformRecursiveContainerStart($id, $pullContainer); $this->PerformRecursiveContainerStart($id, $pullImage);
} }
public function StartWatchtowerContainer(Request $request, Response $response, array $args) : Response { public function StartWatchtowerContainer(Request $request, Response $response, array $args) : Response {

View file

@ -577,7 +577,7 @@ class DockerActionManager
} }
public function PullContainer(Container $container) : void public function PullImage(Container $container) : void
{ {
$url = $this->BuildApiUrl(sprintf('images/create?fromImage=%s', urlencode($this->BuildImageName($container)))); $url = $this->BuildApiUrl(sprintf('images/create?fromImage=%s', urlencode($this->BuildImageName($container))));
// do not catch any exception so that it always throws and logs the error // do not catch any exception so that it always throws and logs the error