Skip to content

Commit f595358

Browse files
authored
Merge pull request #552 from nextcloud/chore/del-deprecated-image-format
chore: removed support of old docker image format
2 parents dce2a26 + 18eec29 commit f595358

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

lib/DeployActions/DockerActions.php

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,6 @@ public function buildBaseImageName(array $imageParams): string {
308308
}
309309

310310
private function buildExtendedImageName(array $imageParams, DaemonConfig $daemonConfig): ?string {
311-
if (empty($daemonConfig->getDeployConfig()['computeDevice']['id'])) {
312-
return null;
313-
}
314-
return $imageParams['image_src'] . '/' .
315-
$imageParams['image_name'] . '-' . $daemonConfig->getDeployConfig()['computeDevice']['id'] . ':' . $imageParams['image_tag'];
316-
}
317-
318-
private function buildExtendedImageName2(array $imageParams, DaemonConfig $daemonConfig): ?string {
319311
if (empty($daemonConfig->getDeployConfig()['computeDevice']['id'])) {
320312
return null;
321313
}
@@ -462,33 +454,19 @@ public function removeContainer(string $dockerUrl, string $containerId): string
462454
public function pullImage(
463455
string $dockerUrl, array $params, ExApp $exApp, int $startPercent, int $maxPercent, DaemonConfig $daemonConfig, string &$imageId
464456
): string {
465-
$imageId = $this->buildExtendedImageName2($params, $daemonConfig);
466-
if ($imageId) {
467-
try {
468-
$r = $this->pullImageInternal($dockerUrl, $exApp, $startPercent, $maxPercent, $imageId);
469-
if ($r === '') {
470-
$this->logger->info(sprintf('Successfully pulled "extended" image in a new name format: %s', $imageId));
471-
return '';
472-
}
473-
$this->logger->info(sprintf('Failed to pull "extended" image(%s): %s', $imageId, $r));
474-
} catch (GuzzleException $e) {
475-
$this->logger->info(
476-
sprintf('Failed to pull "extended" image(%s), GuzzleException occur: %s', $imageId, $e->getMessage())
477-
);
478-
}
479-
}
480-
$imageId = $this->buildExtendedImageName($params, $daemonConfig); // TODO: remove with drop of NC29 support
457+
$urlToLog = $this->useSocket ? $this->socketAddress : $dockerUrl;
458+
$imageId = $this->buildExtendedImageName($params, $daemonConfig);
481459
if ($imageId) {
482460
try {
483461
$r = $this->pullImageInternal($dockerUrl, $exApp, $startPercent, $maxPercent, $imageId);
484462
if ($r === '') {
485-
$this->logger->info(sprintf('Successfully pulled "extended" image in an old name format: %s', $imageId));
463+
$this->logger->info(sprintf('Successfully pulled "extended" image: %s', $imageId));
486464
return '';
487465
}
488466
$this->logger->info(sprintf('Failed to pull "extended" image(%s): %s', $imageId, $r));
489467
} catch (GuzzleException $e) {
490468
$this->logger->info(
491-
sprintf('Failed to pull "extended" image(%s), GuzzleException occur: %s', $imageId, $e->getMessage())
469+
sprintf('Failed to pull "extended" image via "%s", GuzzleException occur: %s', $urlToLog, $e->getMessage())
492470
);
493471
}
494472
}
@@ -500,7 +478,6 @@ public function pullImage(
500478
$this->logger->info(sprintf('Image(%s) pulled successfully.', $imageId));
501479
}
502480
} catch (GuzzleException $e) {
503-
$urlToLog = $this->useSocket ? $this->socketAddress : $dockerUrl;
504481
$r = sprintf('Failed to pull image via "%s", GuzzleException occur: %s', $urlToLog, $e->getMessage());
505482
}
506483
return $r;

0 commit comments

Comments
 (0)