Skip to content

Commit

Permalink
rename pullContainer to pullImage
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <[email protected]>
  • Loading branch information
szaimen committed Nov 20, 2023
1 parent 03aa7a1 commit f935993
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions php/src/Controller/DockerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public function __construct(
$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);

foreach($container->GetDependsOn() as $dependency) {
$this->PerformRecursiveContainerStart($dependency, $pullContainer);
$this->PerformRecursiveContainerStart($dependency, $pullImage);
}

// Don't start if container is already running
Expand All @@ -43,15 +43,15 @@ private function PerformRecursiveContainerStart(string $id, bool $pullContainer
// Skip database image pull if the last shutdown was not clean
if ($id === 'nextcloud-aio-database') {
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.');
}
}

$this->dockerActionManager->DeleteContainer($container);
$this->dockerActionManager->CreateVolumes($container);
if ($pullContainer) {
$this->dockerActionManager->PullContainer($container);
if ($pullImage) {
$this->dockerActionManager->PullImage($container);
}
$this->dockerActionManager->CreateContainer($container);
$this->dockerActionManager->StartContainer($container);
Expand Down Expand Up @@ -188,7 +188,7 @@ public function StartContainer(Request $request, Response $response, array $args
return $response->withStatus(201)->withHeader('Location', '/');
}

public function startTopContainer(bool $pullContainer) : void {
public function startTopContainer(bool $pullImage) : void {
$config = $this->configurationManager->GetConfig();
// set AIO_TOKEN
$config['AIO_TOKEN'] = bin2hex(random_bytes(24));
Expand All @@ -199,7 +199,7 @@ public function startTopContainer(bool $pullContainer) : void {

$id = self::TOP_CONTAINER;

$this->PerformRecursiveContainerStart($id, $pullContainer);
$this->PerformRecursiveContainerStart($id, $pullImage);
}

public function StartWatchtowerContainer(Request $request, Response $response, array $args) : Response {
Expand Down
2 changes: 1 addition & 1 deletion php/src/Docker/DockerActionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ public function CreateContainer(Container $container) : void {

}

public function PullContainer(Container $container) : void
public function PullImage(Container $container) : void
{
$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
Expand Down

0 comments on commit f935993

Please sign in to comment.