-
Notifications
You must be signed in to change notification settings - Fork 670
Check manually-assigned addresses with IPAM to see if they clash #1200
Conversation
yes, please. |
Done |
resultChan := make(chan error) | ||
op := &claim{resultChan: resultChan, ident: ident, addr: addr} | ||
op := &claim{resultChan: resultChan, ident: ident, addr: addr, launch: launch} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I think these are two different operations, rather than a variation on one operation (and perhaps that is why I was confused by "launch"). The first is to tell weave about an IP that had been claimed previously. The second is to ask for a particular IP that has not been handed out previously. It's actually the latter that deserves the name "Claim"; the former is more like, well, "Reclaim" or "Recover". How this is reflected in the HTTP API, I'm not sure -- PUT to a URL seems a good match for both. So a query arg might be appropriate for discriminating. |
I renamed 'launch' to 'reclaim'; rebased and squashed. |
c406723
to
647b755
Compare
@@ -12,6 +12,7 @@ type claim struct { | |||
resultChan chan<- error | |||
ident string | |||
addr address.Address | |||
reclaim bool | |||
} | |||
|
|||
func (c *claim) sendResult(result error) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I decided |
alloc.infof("Claim %s for %s: address allocator still initializing; will try later.", c.addr, c.ident) | ||
c.sendResult(nil) // don't make the caller wait | ||
} else { | ||
c.sendResult(fmt.Errorf("%s is in the range %s, but the allocator is not initialized yet", c.addr, alloc.universe.AsCIDRString())) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I struggle to see how this solves #598. Please explain. |
Line 866 in the |
ok |
I should perhaps have updated the docs, where it says
|
Surely http://docs.weave.works/weave/master/head/ipam.html#manual should be updated. |
Update docs for mixed manual and automatic IP allocation Missed from #1200.
Fixes #687 and #598
One quiet change in this PR: