mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-10 17:48:25 +08:00
bug fixes
This commit is contained in:
parent
a2392721e9
commit
3596754734
2 changed files with 8 additions and 1 deletions
|
@ -18,7 +18,6 @@ func DefaultHandler(client mqtt.Client, msg mqtt.Message) {
|
|||
|
||||
// Ping message Handler -- handles ping topic from client nodes
|
||||
func Ping(client mqtt.Client, msg mqtt.Message) {
|
||||
logger.Log(0, "Ping Handler: ", msg.Topic())
|
||||
go func() {
|
||||
id, err := getID(msg.Topic())
|
||||
if err != nil {
|
||||
|
|
|
@ -55,6 +55,7 @@ func NodeUpdate(client mqtt.Client, msg mqtt.Message) {
|
|||
// check if interface needs to delta
|
||||
ifaceDelta := ncutils.IfaceDelta(&nodeCfg.Node, &newNode)
|
||||
shouldDNSChange := nodeCfg.Node.DNSOn != newNode.DNSOn
|
||||
hubChange := nodeCfg.Node.IsHub != newNode.IsHub
|
||||
|
||||
nodeCfg.Node = newNode
|
||||
switch newNode.Action {
|
||||
|
@ -126,6 +127,13 @@ func NodeUpdate(client mqtt.Client, msg mqtt.Message) {
|
|||
} else {
|
||||
ncutils.Log("signalled finished interface update to server")
|
||||
}
|
||||
} else if hubChange {
|
||||
doneErr := publishSignal(&commsCfg, &nodeCfg, ncutils.DONE)
|
||||
if doneErr != nil {
|
||||
ncutils.Log("could not notify server to update peers after hub change")
|
||||
} else {
|
||||
ncutils.Log("signalled finished hub update to server")
|
||||
}
|
||||
}
|
||||
//deal with DNS
|
||||
if newNode.DNSOn != "yes" && shouldDNSChange && nodeCfg.Node.Interface != "" {
|
||||
|
|
Loading…
Reference in a new issue