Resource manager mutations IPPrefixPoolGetResourceInput and IPAddressPoolGetResourceInput both expose a parameter related to the prefix length to set on the object to allocate.
They use different naming, which is a bit confusion, but those parameters are ignored when executing the mutations. This is due to the mutations code which looks for prefixlen instead of the parameter names, thus always defaulting the value to None.
The prefix length for address is also expected as a string by GraphQL which is wrong.
Expected Behavior
Having the same name for the parameter for both IP address and IP prefix
Allocated nodes should have the proper prefix length
Steps to Reproduce
Start infrahub and load demo schema and data
Try running the mutation above (with a correct ID)
Observe the prefix length will not match what was asked
mutation AllocateIPPrefix {
IPPrefixPoolGetResource(
data: {id: "17d7a9d6-92ec-f1d8-2784-179f9720a4b7", size:31}
) {
ok
node {
id
}
}
}
Component
API Server / GraphQL
Current Behavior
Resource manager mutations
IPPrefixPoolGetResourceInput
andIPAddressPoolGetResourceInput
both expose a parameter related to the prefix length to set on the object to allocate.They use different naming, which is a bit confusion, but those parameters are ignored when executing the mutations. This is due to the mutations code which looks for
prefixlen
instead of the parameter names, thus always defaulting the value toNone
.The prefix length for address is also expected as a string by GraphQL which is wrong.
Expected Behavior
Steps to Reproduce
Additional Information
No response