Fixed image name sync
testing/ogcore-api/pipeline/head There was a failure building this commit Details

pull/102/head
Manuel Aranda Rosales 2026-04-30 14:38:25 +02:00
parent 2b3e0a8350
commit 80948dda38
4 changed files with 5 additions and 12 deletions

View File

@ -93,18 +93,12 @@ class OrganizationalUnitController extends AbstractController
->getRepository(ImageImageRepository::class)
->findBy(['remotePc' => true]);
$seen = [];
$data = [];
foreach ($iirs as $iir) {
$image = $iir->getImage();
if (!$image || isset($seen[$image->getId()])) {
continue;
}
$seen[$image->getId()] = true;
$data[] = [
'id' => $image->getId(),
'name' => $image->getName(),
'id' => $iir->getId(),
'name' => $iir->getName(),
'inremotepc' => true,
'ou' => ['id' => $centerId],
];

View File

@ -263,7 +263,7 @@ class RemotePcController extends AbstractController
{
foreach ($client->getPartitions() as $partition) {
$iir = $partition->getImage();
if ($iir && $iir->getImage() && $iir->getImage()->getId() === $imageId) {
if ($iir && $iir->getId() === $imageId) {
return $partition;
}
}

View File

@ -174,11 +174,10 @@ class ClientRepository extends AbstractRepository
->join('c.organizationalUnit', 'lab')
->join('c.partitions', 'p')
->join('p.image', 'iir')
->join('iir.image', 'img')
->leftJoin('c.remotePC', 'rpc')
->where('lab.path LIKE :pathPrefix')
->andWhere('lab.remotePc = true')
->andWhere('img.id = :imageId')
->andWhere('iir.id = :imageId')
->andWhere('iir.remotePc = true')
->andWhere('c.maintenance = false')
->andWhere('(rpc.reservedUntil IS NULL OR rpc.reservedUntil < :now)')

View File

@ -250,7 +250,7 @@ class UDSClient
{
foreach ($client->getPartitions() as $partition) {
$iir = $partition->getImage();
if ($iir && $iir->getImage() && $iir->getImage()->getId() === $imageId) {
if ($iir && $iir->getId() === $imageId) {
return true;
}
}