Rework getAvailableIp
This commit reworks getAvailableIp with a "simpler" version that will look for the first available IP address in our IP Prefix. There is a couple of ideas behind this: * Make the host IPs reasonably predictable and in within similar subnets, which should simplify ACLs for subnets * The code is not random, but deterministic so we can have tests * The code is a bit more understandable (no bit shift magic)
This commit is contained in:
parent
309f868a21
commit
b5841c8a8b
4 changed files with 170 additions and 45 deletions
|
@ -15,6 +15,7 @@ func (s *Suite) TestRegisterMachine(c *check.C) {
|
|||
DiscoKey: "faa",
|
||||
Name: "testmachine",
|
||||
NamespaceID: n.ID,
|
||||
IPAddress: "10.0.0.1",
|
||||
}
|
||||
h.db.Save(&m)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue