Skip to content

Commit

Permalink
Merge pull request #5503 from nextcloud/enh/noid/fix-getting-tag
Browse files Browse the repository at this point in the history
DockerActionManager: fix getting the tag from the image
  • Loading branch information
szaimen authored Nov 6, 2024
2 parents 9e2b862 + a625570 commit bb3236d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions php/src/Docker/DockerActionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -736,16 +736,13 @@ public function GetCurrentChannel() : string {
$output = json_decode($this->guzzleClient->get($url)->getBody()->getContents(), true);
$containerChecksum = $output['Image'];
$tagArray = explode(':', $output['Config']['Image']);
$tag = $tagArray[1];
apcu_add($cacheKey, $tag);
/**
* @psalm-suppress TypeDoesNotContainNull
* @psalm-suppress DocblockTypeContradiction
*/
if ($tag === null) {
if (count($tagArray) === 2) {
$tag = $tagArray[1];
} else {
error_log("No tag was found when getting the current channel. You probably did not follow the documentation correctly. Changing the channel to the default 'latest'.");
$tag = 'latest';
}
apcu_add($cacheKey, $tag);
return $tag;
} catch (\Exception $e) {
error_log('Could not get current channel ' . $e->getMessage());
Expand Down

0 comments on commit bb3236d

Please sign in to comment.