Merge pull request #1069 from nextcloud/fix/1067/fix-pulling-images

do not pull containers if START_CONTAINERS was provided and not …
This commit is contained in:
Simon L 2022-09-08 15:45:54 +02:00 committed by GitHub
commit 8c544d96c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,20 +30,19 @@ class DockerController
$container = $this->containerDefinitionFetcher->GetContainerById($id); $container = $this->containerDefinitionFetcher->GetContainerById($id);
foreach($container->GetDependsOn() as $dependency) { foreach($container->GetDependsOn() as $dependency) {
$this->PerformRecursiveContainerStart($dependency); $this->PerformRecursiveContainerStart($dependency, $pullContainer);
} }
if ($id === 'nextcloud-aio-database') { if ($id === 'nextcloud-aio-database') {
if ($this->dockerActionManager->GetDatabasecontainerExitCode() > 0) { if ($this->dockerActionManager->GetDatabasecontainerExitCode() > 0) {
$pullContainer = false; $pullContainer = false;
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 ($pullContainer) {
$this->dockerActionManager->PullContainer($container); $this->dockerActionManager->PullContainer($container);
} else {
error_log('Not pulling the latest database image because the container was not correctly shut down.');
} }
$this->dockerActionManager->CreateContainer($container); $this->dockerActionManager->CreateContainer($container);
$this->dockerActionManager->StartContainer($container); $this->dockerActionManager->StartContainer($container);