Use localNode to store the local node name
Also rename setupDelegate to SetLocalNode, so that main can call SetLocalNode then Update().
This commit is contained in:
7
main.go
7
main.go
@ -50,11 +50,12 @@ func main() {
|
||||
}
|
||||
|
||||
// Assign a local node address and propagate it to the cluster
|
||||
wgstate.AssignOverlayAddr((*net.IPNet)(config.OverlayNet), cluster.LocalName)
|
||||
localNode := common.Node{}
|
||||
wgstate.AssignOverlayAddr((*net.IPNet)(config.OverlayNet), cluster.Name())
|
||||
localNode := &common.Node{}
|
||||
localNode.OverlayAddr = wgstate.OverlayAddr
|
||||
localNode.PubKey = wgstate.PubKey.String()
|
||||
cluster.Update(localNode)
|
||||
cluster.SetLocalNode(localNode)
|
||||
cluster.Update()
|
||||
|
||||
// Join the cluster
|
||||
nodec := cluster.Members() // avoid deadlocks by starting before join
|
||||
|
Reference in New Issue
Block a user