diff --git a/functions/mqhandlers.go b/functions/mqhandlers.go index ab1ba7a0..73f06bc5 100644 --- a/functions/mqhandlers.go +++ b/functions/mqhandlers.go @@ -243,6 +243,7 @@ func HostUpdate(client mqtt.Client, msg mqtt.Message) { clearRetainedMsg(client, msg.Topic()) // clear message UpdateKeys() case models.RequestPull: + clearRetainedMsg(client, msg.Topic()) Pull(true) default: slog.Error("unknown host action", "action", hostUpdate.Action) diff --git a/functions/pull.go b/functions/pull.go index 1e086563..7ed39b04 100644 --- a/functions/pull.go +++ b/functions/pull.go @@ -45,6 +45,7 @@ func Pull(restart bool) error { pullResponse.ServerConfig.MQPassword = server.MQPassword // pwd can't change currently config.UpdateServerConfig(&pullResponse.ServerConfig) config.SetNodes(pullResponse.Nodes) + config.UpdateHost(&pullResponse.Host) fmt.Printf("completed pull for server %s\n", serverName) _ = config.WriteServerConfig() _ = config.WriteNetclientConfig() diff --git a/go.mod b/go.mod index d56a6b2b..7b8df3db 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/google/nftables v0.1.0 github.com/google/uuid v1.3.0 github.com/gorilla/websocket v1.5.0 - github.com/gravitl/netmaker v0.20.6-0.20230809123305-36b444e13a18 + github.com/gravitl/netmaker v0.20.6 github.com/gravitl/tcping v0.1.2-0.20230801110928-546055ebde06 github.com/gravitl/txeh v0.0.0-20230509181318-3778c58bd69f github.com/guumaster/hostctl v1.1.4 diff --git a/go.sum b/go.sum index 2b2749fb..290680de 100644 --- a/go.sum +++ b/go.sum @@ -185,8 +185,8 @@ github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gravitl/netmaker v0.20.6-0.20230809123305-36b444e13a18 h1:nSR9x+f2tBTfy13fBS18zlTz0KXI3RKTrWDnU5ZWGt8= -github.com/gravitl/netmaker v0.20.6-0.20230809123305-36b444e13a18/go.mod h1:OlDRACyy/VRRk2bGHUhoD0eBt5eoUIs6FodIveNRZRM= +github.com/gravitl/netmaker v0.20.6 h1:PrtmKujExojp3xa+Wk3HzoT1bCd5Tbk5BQLQHfdLdEE= +github.com/gravitl/netmaker v0.20.6/go.mod h1:OlDRACyy/VRRk2bGHUhoD0eBt5eoUIs6FodIveNRZRM= github.com/gravitl/tcping v0.1.2-0.20230801110928-546055ebde06 h1:g2fBXRNT9eiQohyHcoME3SVmeG7OKoJPWrs7A+009kU= github.com/gravitl/tcping v0.1.2-0.20230801110928-546055ebde06/go.mod h1:12iViYKWAzRPj5/oEGAaD7Wje+Nuz8M9eDJbV7qhKAA= github.com/gravitl/txeh v0.0.0-20230509181318-3778c58bd69f h1:XzsYovKdrDvj2z2HEHoeHU67+JIEFMHQKHU6oU+1fVE=