From 7902e2e75b3e749140b28f1db1432907fb7b7ca8 Mon Sep 17 00:00:00 2001 From: szaimen Date: Sun, 5 Dec 2021 14:03:05 +0100 Subject: [PATCH] improve channel logic to work as expected Signed-off-by: szaimen --- php/src/Docker/DockerActionManager.php | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index 2b180310..85c6099e 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -47,12 +47,7 @@ class DockerActionManager } private function BuildImageName(Container $container) : string { - $channel = $this->GetCurrentChannel(); - if ($channel === 'develop') { - return $container->GetContainerName() . ':develop'; - } else { - return $container->GetContainerName() . ':latest'; - } + return $container->GetContainerName() . ':' . $this->GetCurrentChannel(); } public function GetContainerRunningState(Container $container) : IContainerState @@ -79,12 +74,7 @@ class DockerActionManager public function GetContainerUpdateState(Container $container) : IContainerState { - $channel = $this->GetCurrentChannel(); - if ($channel === 'develop') { - $tag = 'develop'; - } else { - $tag = 'latest'; - } + $tag = $this->GetCurrentChannel(); $runningDigest = $this->GetRepoDigestOfContainer($container->GetIdentifier()); $remoteDigest = $this->dockerHubManager->GetLatestDigestOfTag($container->GetContainerName(), $tag); @@ -350,12 +340,7 @@ class DockerActionManager $imageName = 'nextcloud/all-in-one'; $containerName = 'nextcloud-aio-mastercontainer'; - $channel = $this->GetCurrentChannel(); - if ($channel === 'develop') { - $tag = 'develop'; - } else { - $tag = 'latest'; - } + $tag = $this->GetCurrentChannel(); $runningDigest = $this->GetRepoDigestOfContainer($containerName); $remoteDigest = $this->dockerHubManager->GetLatestDigestOfTag($imageName, $tag);