diff --git a/ips/ips.go b/ips/ips.go index e29ad539e..67d84fab2 100644 --- a/ips/ips.go +++ b/ips/ips.go @@ -338,6 +338,9 @@ func filterAndSortPools(ctx *context.Context, tenant string, pools []*utils.IPPo weights[pool.ID] = weight filteredPools = append(filteredPools, pool) } + if len(filteredPools) == 0 { + return nil, utils.ErrNotFound + } // Sort by weight (higher values first). slices.SortFunc(filteredPools, func(a, b *utils.IPPool) int {