fix: stop querying removed host address column

dev
admin 1 month ago
parent fc01273112
commit e7230fffe2

@ -411,9 +411,8 @@ final class CloudAdminResourceService
->whereColumn('public_pool.host_id', 'cloud_public_ips.host_id')
->whereColumn('network_attachment.host_id',
'cloud_public_ips.host_id')
// The engine reserves a literal management IPv4 implicitly;
// never advertise a stale panel row for that address.
->whereColumn('cloud_public_ips.address', '<>', 'eligible_host.host')
// Gateway, DNS and management addresses are disabled while
// materializing the pool's reserved_ips ledger.
->whereColumn('network_attachment.network_selector',
'eligible_host.default_network')
->where(function ($query): void {
@ -454,7 +453,6 @@ final class CloudAdminResourceService
->whereNull('cloud_public_ips.instance_id')
->whereNull('cloud_public_ips.operation_id')
->whereColumn('cloud_public_ips.host_id', 'public_pool.host_id')
->whereColumn('cloud_public_ips.address', '<>', 'eligible_host.host')
->whereColumn('cloud_public_ips.prefix_length',
'public_pool.guest_prefix_length')
->whereColumn('network_attachment.host_id',

@ -110,7 +110,7 @@ final class CloudEngineClient
return $result;
}
private static function safeAllowlistedError(?string $path, array $result, int $status): ?string
private static function safeAllowlistedError(?string $path, array $result, ?int $status = null): ?string
{
if ($path === null) {
return null;

@ -13,10 +13,14 @@ use App\Models\CloudResourceReservation;
*/
final class CloudPanelUsageService
{
/** Return a literal management IPv4 that the engine reserves implicitly. */
/**
* The panel deliberately does not persist the engine's SSH/management
* address in cloud_hosts. Operators must put a management IPv4 in the
* public-pool reserved_ips list, which is materialized into the ledger.
*/
public static function managementAddress(?CloudHost $host): ?string
{
return self::managementAddressFromValue($host?->host);
return null;
}
public static function managementAddressFromValue($value): ?string

@ -745,6 +745,9 @@ final class CloudPlacementService
if ($lineId < 1) {
return [];
}
// Management, gateway, DNS and other operator-owned addresses are
// removed from the ledger when the pool's reserved_ips is materialized.
// cloud_hosts intentionally has no engine/SSH host-address column.
$rows = CloudPublicIp::query()->join(
'cloud_public_ip_pools as public_pool',
'public_pool.id', '=', 'cloud_public_ips.public_ip_pool_id'
@ -760,7 +763,6 @@ final class CloudPlacementService
->whereNull('cloud_public_ips.instance_id')
->whereNull('cloud_public_ips.operation_id')
->whereColumn('cloud_public_ips.host_id', 'public_pool.host_id')
->whereColumn('cloud_public_ips.address', '<>', 'eligible_host.host')
->whereColumn('cloud_public_ips.prefix_length',
'public_pool.guest_prefix_length')
->whereColumn('cloud_public_ips.host_id', 'network_attachment.host_id')
@ -778,15 +780,9 @@ final class CloudPlacementService
->distinct()->get([
'cloud_public_ips.host_id', 'cloud_public_ips.address',
'public_pool.pool_key', 'public_pool.cidr',
'eligible_host.host as management_host',
]);
$available = [];
foreach ($rows as $row) {
if (CloudPanelUsageService::managementAddressFromValue(
$row->management_host ?? null
) === (string) $row->address) {
continue;
}
if (preg_match('/^[a-f0-9]{32}$/D', (string) $row->pool_key) === 1
&& self::ipv4BelongsToCidr(
(string) $row->address, (string) $row->cidr

@ -1,2 +1,2 @@
{* Shared Venix CSS/JS cache key. Increment whenever a shared browser asset changes. *}
{assign var=venix_asset_version value='2026100602' scope='global'}
{assign var=venix_asset_version value='2026100701' scope='global'}

@ -59,6 +59,7 @@ $assert(str_contains($feature, "CONFIG_KEY = 'cloud_network_lines_enabled'")
&& str_contains($service, 'CloudHostCapacityPolicy')
&& str_contains($service, 'CloudResourceReservation')
&& str_contains($service, 'CloudPanelUsageService')
&& !str_contains($service, 'eligible_host.host')
&& !str_contains($service, 'CloudHostCapacitySnapshot')
&& !str_contains($service, 'CloudEngineClient'),
'Resource projections must be DB-only, use policy and reservation ledgers, and retain a disabled-by-default line feature.');

@ -86,6 +86,7 @@ $assert(is_string($worker)
'Worker no longer confirms pool identity or settles every terminal/ambiguous network-change outcome.');
$assert(is_string($placement)
&& str_contains($placement, 'cloud_host_resource_pool_memberships as pool_membership')
&& !str_contains($placement, 'eligible_host.host')
&& !str_contains($placement, "->where('cloud_hosts.resource_pool_id', \$poolId)")
&& str_contains($placement, '$reservation->network_attachment_id = $selectedAttachment->id')
&& str_contains($placement, '$reservation->public_ip_pool_id = $selectedPool->id')

Loading…
Cancel
Save