mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
![Jana Radhakrishnan](/assets/img/avatar_default.png)
When a node goes away purge all the network attachments from the node and make sure we don't attempt bulk syncing to that node once removed. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
24 lines
482 B
Go
24 lines
482 B
Go
package networkdb
|
|
|
|
import "github.com/hashicorp/memberlist"
|
|
|
|
type eventDelegate struct {
|
|
nDB *NetworkDB
|
|
}
|
|
|
|
func (e *eventDelegate) NotifyJoin(n *memberlist.Node) {
|
|
e.nDB.Lock()
|
|
e.nDB.nodes[n.Name] = n
|
|
e.nDB.Unlock()
|
|
}
|
|
|
|
func (e *eventDelegate) NotifyLeave(n *memberlist.Node) {
|
|
e.nDB.deleteNodeTableEntries(n.Name)
|
|
e.nDB.deleteNetworkNodeEntries(n.Name)
|
|
e.nDB.Lock()
|
|
delete(e.nDB.nodes, n.Name)
|
|
e.nDB.Unlock()
|
|
}
|
|
|
|
func (e *eventDelegate) NotifyUpdate(n *memberlist.Node) {
|
|
}
|