From 18eec29895eb4a83bb9a4840804af575ff1d67dc Mon Sep 17 00:00:00 2001 From: Oleksander Piskun Date: Mon, 14 Apr 2025 10:06:50 +0300 Subject: [PATCH] =?UTF-8?q?chore:=20removed=20support=20of=20old=20docker?= =?UTF-8?q?=20image=20format=20like=20"repostiry-name-{COMPUTE=5FDEVI?= =?UTF-8?q?=D0=A1E=5FTYPE}:tag"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Oleksander Piskun --- lib/DeployActions/DockerActions.php | 31 ++++------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/lib/DeployActions/DockerActions.php b/lib/DeployActions/DockerActions.php index 688388a2..59854ba8 100644 --- a/lib/DeployActions/DockerActions.php +++ b/lib/DeployActions/DockerActions.php @@ -308,14 +308,6 @@ public function buildBaseImageName(array $imageParams): string { } private function buildExtendedImageName(array $imageParams, DaemonConfig $daemonConfig): ?string { - if (empty($daemonConfig->getDeployConfig()['computeDevice']['id'])) { - return null; - } - return $imageParams['image_src'] . '/' . - $imageParams['image_name'] . '-' . $daemonConfig->getDeployConfig()['computeDevice']['id'] . ':' . $imageParams['image_tag']; - } - - private function buildExtendedImageName2(array $imageParams, DaemonConfig $daemonConfig): ?string { if (empty($daemonConfig->getDeployConfig()['computeDevice']['id'])) { return null; } @@ -462,33 +454,19 @@ public function removeContainer(string $dockerUrl, string $containerId): string public function pullImage( string $dockerUrl, array $params, ExApp $exApp, int $startPercent, int $maxPercent, DaemonConfig $daemonConfig, string &$imageId ): string { - $imageId = $this->buildExtendedImageName2($params, $daemonConfig); - if ($imageId) { - try { - $r = $this->pullImageInternal($dockerUrl, $exApp, $startPercent, $maxPercent, $imageId); - if ($r === '') { - $this->logger->info(sprintf('Successfully pulled "extended" image in a new name format: %s', $imageId)); - return ''; - } - $this->logger->info(sprintf('Failed to pull "extended" image(%s): %s', $imageId, $r)); - } catch (GuzzleException $e) { - $this->logger->info( - sprintf('Failed to pull "extended" image(%s), GuzzleException occur: %s', $imageId, $e->getMessage()) - ); - } - } - $imageId = $this->buildExtendedImageName($params, $daemonConfig); // TODO: remove with drop of NC29 support + $urlToLog = $this->useSocket ? $this->socketAddress : $dockerUrl; + $imageId = $this->buildExtendedImageName($params, $daemonConfig); if ($imageId) { try { $r = $this->pullImageInternal($dockerUrl, $exApp, $startPercent, $maxPercent, $imageId); if ($r === '') { - $this->logger->info(sprintf('Successfully pulled "extended" image in an old name format: %s', $imageId)); + $this->logger->info(sprintf('Successfully pulled "extended" image: %s', $imageId)); return ''; } $this->logger->info(sprintf('Failed to pull "extended" image(%s): %s', $imageId, $r)); } catch (GuzzleException $e) { $this->logger->info( - sprintf('Failed to pull "extended" image(%s), GuzzleException occur: %s', $imageId, $e->getMessage()) + sprintf('Failed to pull "extended" image via "%s", GuzzleException occur: %s', $urlToLog, $e->getMessage()) ); } } @@ -500,7 +478,6 @@ public function pullImage( $this->logger->info(sprintf('Image(%s) pulled successfully.', $imageId)); } } catch (GuzzleException $e) { - $urlToLog = $this->useSocket ? $this->socketAddress : $dockerUrl; $r = sprintf('Failed to pull image via "%s", GuzzleException occur: %s', $urlToLog, $e->getMessage()); } return $r;