Merge pull request #6303 from nextcloud/enh/6302/fix-outdated-notification

DockerActionManager: fix Nextcloud is oudated notification
This commit is contained in:
Simon L. 2025-04-17 10:30:00 +02:00 committed by GitHub
commit a7a5e849fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1030,8 +1030,8 @@ readonly class DockerActionManager {
return false; return false;
} }
private function GetCreatedTimeOfNextcloudImage(): ?string { private function GetCreatedTimeOfNextcloudImage(string $imageName): ?string {
$imageName = 'nextcloud/aio-nextcloud' . ':' . $this->GetCurrentChannel(); $imageName = $imageName . ':' . $this->GetCurrentChannel();
try { try {
$imageUrl = $this->BuildApiUrl(sprintf('images/%s/json', $imageName)); $imageUrl = $this->BuildApiUrl(sprintf('images/%s/json', $imageName));
$imageOutput = json_decode($this->guzzleClient->get($imageUrl)->getBody()->getContents(), true); $imageOutput = json_decode($this->guzzleClient->get($imageUrl)->getBody()->getContents(), true);
@ -1052,7 +1052,11 @@ readonly class DockerActionManager {
} }
public function isNextcloudImageOutdated(): bool { public function isNextcloudImageOutdated(): bool {
$createdTime = $this->GetCreatedTimeOfNextcloudImage(); $createdTime = $this->GetCreatedTimeOfNextcloudImage('ghcr.io/nextcloud-releases/aio-nextcloud');
if ($createdTime === null) {
$createdTime = $this->GetCreatedTimeOfNextcloudImage('nextcloud/aio-nextcloud');
}
if ($createdTime === null) { if ($createdTime === null) {
return false; return false;