Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/worker/DrydockAllocatorWorker.php
| Show First 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | if ($resource) { | ||||
| try { | try { | ||||
| foreach ($blueprints as $key => $candidate_blueprint) { | foreach ($blueprints as $key => $candidate_blueprint) { | ||||
| $rpool = idx($resources_per_blueprint, $key, array()); | $rpool = idx($resources_per_blueprint, $key, array()); | ||||
| if (!$candidate_blueprint->canAllocateMoreResources($rpool)) { | if (!$candidate_blueprint->canAllocateMoreResources($rpool)) { | ||||
| unset($blueprints[$key]); | unset($blueprints[$key]); | ||||
| continue; | continue; | ||||
| } | } | ||||
| if ($candidate_blueprint->supportsAutomaticCustomAttributes()) { | |||||
| $custom_match = DrydockCustomAttributes::hasRequirements( | |||||
| $lease->getAttributes(), | |||||
| $candidate_blueprint->getDetail('attributes', '')); | |||||
| if (!$custom_match) { | |||||
| unset($blueprints[$key]); | |||||
| continue; | |||||
| } | |||||
| } | |||||
| if (!$candidate_blueprint->canAllocateResourceForLease($lease)) { | if (!$candidate_blueprint->canAllocateResourceForLease($lease)) { | ||||
| unset($blueprints[$key]); | unset($blueprints[$key]); | ||||
| continue; | continue; | ||||
| } | } | ||||
| } | } | ||||
| $this->logToDrydock( | $this->logToDrydock( | ||||
| pht('%d Blueprints Can Allocate', count($blueprints))); | pht('%d Blueprints Can Allocate', count($blueprints))); | ||||
| ▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines | |||||