Component
Python SDK
Infrahub SDK version
1.20.0
Current Behavior
I have a generator that consumes pools and prefixes. Somehow the pool can allocate multiple times the same prefix:
❯ uv run infrahubctl generator site_pool_generator --branch=test-123456 name=placeholder-site
Allocated underlay prefix `172.16.0.156/30` for identifier `underlay_leafs`
Allocated prefix `172.16.0.156/30` from pool `placeholder-site-underlay_leafs-pool` for identifier `underlay_leafs-sub-1`
Allocated prefix `172.16.0.156/30` from pool `placeholder-site-underlay_leafs-pool` for identifier `underlay_leafs-sub-2`
Allocated underlay prefix `172.16.0.160/30` for identifier `underlay_spines`
Allocated prefix `172.16.0.160/30` from pool `placeholder-site-underlay_spines-pool` for identifier `underlay_spines-sub-1`
Allocated prefix `172.16.0.160/30` from pool `placeholder-site-underlay_spines-pool` for identifier `underlay_spines-sub-2`
Allocated underlay prefix `172.16.0.164/30` for identifier `underlay_oob`
Allocated prefix `172.16.0.164/30` from pool `placeholder-site-underlay_oob-pool` for identifier `underlay_oob-sub-1`
Allocated prefix `172.16.0.164/30` from pool `placeholder-site-underlay_oob-pool` for identifier `underlay_oob-sub-2`
Expected Behavior
I guess pool should return a "no more resource available" kind of message.
Steps to Reproduce
- Load this schema
uv run infrahubctl schema load site_pool_schema.yml
site_pool_schema.yml
- Load objects
uv run infrahubctl object load objects
00_groups.yml
- create branch
uv run infrahubctl branch create test-123
- run generator toward that branch
uv run infrahubctl generator site_pool_generator --branch=test-123 name=placeholder-site
---
schemas:
- site_pool_schema.yml
objects:
- objects
queries:
- name: site_pools
file_path: queries/site_pools.gql
generator_definitions:
- name: site_pool_generator
file_path: generators/site_pool_generator.py
class_name: SitePoolGenerator
query: site_pools
targets: location_sites
parameters:
name: name__value
site_pool_generator.py
Additional Information
The interesting bit here is that parent prefix is a /30 and we try to allocate various /30 out of it. This seems to be a prerequisite for this issue to happen cause it works well if parent is /28 and allocate /30 from it.
Component
Python SDK
Infrahub SDK version
1.20.0
Current Behavior
I have a generator that consumes pools and prefixes. Somehow the pool can allocate multiple times the same prefix:
Expected Behavior
I guess pool should return a "no more resource available" kind of message.
Steps to Reproduce
uv run infrahubctl schema load site_pool_schema.ymlsite_pool_schema.yml
uv run infrahubctl object load objects00_groups.yml
uv run infrahubctl branch create test-123uv run infrahubctl generator site_pool_generator --branch=test-123 name=placeholder-sitesite_pool_generator.py
Additional Information
The interesting bit here is that parent prefix is a
/30and we try to allocate various/30out of it. This seems to be a prerequisite for this issue to happen cause it works well if parent is/28and allocate/30from it.