Dont notify the leave if the serf is not inited

Overlay driver allows local containers to communicate in overly network
even when the serf is not fully inited. But when the container leaves an
overlay network, it gets stuck waiting on a nil notifyCh, when the serf
is not fully initialized.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
Madhu Venugopal 2015-10-24 08:51:15 -07:00
parent e550f1b840
commit 473ce7db08
1 changed files with 6 additions and 4 deletions

View File

@ -118,10 +118,12 @@ func (d *driver) Leave(nid, eid string) error {
return fmt.Errorf("could not find network with id %s", nid) return fmt.Errorf("could not find network with id %s", nid)
} }
d.notifyCh <- ovNotify{ if d.notifyCh != nil {
action: "leave", d.notifyCh <- ovNotify{
nid: nid, action: "leave",
eid: eid, nid: nid,
eid: eid,
}
} }
n.leaveSandbox() n.leaveSandbox()