Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: It's possible to indicated a Default Prefix Size bigger than the resources associated to a Resource Pool #5489

Open
BeArchiTek opened this issue Jan 16, 2025 · 0 comments
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/bug Something isn't working as expected

Comments

@BeArchiTek
Copy link
Contributor

Component

No response

Infrahub version

1.1.2

Current Behavior

It is currently possible to create a PrefixPool with a default prefixlen bigger than the resources allocated to it

Image

If we end up using this Resource Pool with the SDK, without indicating a prefix_length, the allocation will fail with :

mutation AllocateIPPrefix {
    IPPrefixPoolGetResource(
        data: {
            id: "181b2d88-181c-d60a-2ffc-c5156e5d97df"
        }
    ){
        ok
        node {
            id
            kind
            identifier
            display_label
        }
    }
}
, [{'message': 'No more resources available', 'locations': [{'line': 3, 'column': 5}], 'path': ['IPPrefixPoolGetResource']}]

Expected Behavior

I expect at least a warning indicating that the Default Prefix Type is too big for this resource.

Steps to Reproduce

With infrahub demo-schema

  • create a new prefix let's say 10.0.0.0/24
  • create a new resource pool with the information from the previous screenshot
  • save it

Additional Information

No response

@BeArchiTek BeArchiTek added the type/bug Something isn't working as expected label Jan 16, 2025
@BeArchiTek BeArchiTek changed the title bug: bug: It's possible to indicated a Default Prefix Size bigger than the resources associated to a Resource Pool Jan 16, 2025
@BeArchiTek BeArchiTek added the group/backend Issue related to the backend (API Server, Git Agent) label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

1 participant