From 0dee8bac04bbc4de556e0f0c4127f1ccbe5f5ed8 Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Tue, 1 Jul 2025 19:40:02 +0300 Subject: [PATCH] ips: add ProfileID field to AllocatedIP definition --- utils/ips.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/utils/ips.go b/utils/ips.go index 86b9d2521..b7002d221 100644 --- a/utils/ips.go +++ b/utils/ips.go @@ -381,9 +381,10 @@ func (a *PoolAllocation) Clone() *PoolAllocation { // AllocatedIP represents one IP allocated on a pool, together with the message. type AllocatedIP struct { - PoolID string - Message string - Address netip.Addr + ProfileID string + PoolID string + Message string + Address netip.Addr } // IPAllocations represents IP allocations with usage tracking and TTL management. @@ -461,9 +462,10 @@ func (a *IPAllocations) AllocateIPOnPool(allocID string, pool *IPPool, } a.TTLIndex = append(a.TTLIndex, allocID) return &AllocatedIP{ - PoolID: pool.ID, - Message: pool.Message, - Address: poolAlloc.Address, + ProfileID: a.ID, + PoolID: pool.ID, + Message: pool.Message, + Address: poolAlloc.Address, }, nil } poolRange := a.poolRanges[pool.ID] @@ -478,9 +480,10 @@ func (a *IPAllocations) AllocateIPOnPool(allocID string, pool *IPPool, } } allocIP := &AllocatedIP{ - PoolID: pool.ID, - Message: pool.Message, - Address: addr, + ProfileID: a.ID, + PoolID: pool.ID, + Message: pool.Message, + Address: addr, } if dryRun { return allocIP, nil