Closed asadoughi closed 11 years ago
Writing some integration tests for krauq, ran into an existing bug, subnet.allocated_ips has been returning 0 or 1, not the count we want. (Bug exists on master).
I need to patch in:
I think this is a good first cut to still merge in.
Merge conflicted now
Don't merge: fixing issues highlighted by integration tests.
Issues highlighted by integration tests fixed.
An IP Policy is defined on a subnet or network definining what IPs to exclude from allocation. From a user perspective an IP Policy looks like the following:
{ "subnet_id":/None,
"network_id": /None,
"exclude": list of cidrs (e.g. ["0.0.0.0/31", "0.0.0.255/32"])
}
One of "subnet_id" or "network_id" is required. "exclude" is always required. Only create, read, and delete operations are supported.
Only one policy is allowed per network. Thus, if a user would like to "update" the policy on a network they would have to delete an existing policy and create a new one.
If a network's IP policy excludes ranges outside of a subnet's cidr, the IP policy exclusion is only applied as it intersects with the subnet's cidr.