send host update to join network

This commit is contained in:
Abhishek Kondur
2023-01-19 14:01:52 +05:30
parent 99a5cc3307
commit 2bb5e436e0

View File

@@ -207,7 +207,13 @@ func addHostToNetwork(w http.ResponseWriter, r *http.Request) {
return return
} }
logger.Log(1, "added new node", newNode.ID.String(), "to host", currHost.Name) logger.Log(1, "added new node", newNode.ID.String(), "to host", currHost.Name)
if err = mq.HostUpdate(&models.HostUpdate{
Action: models.JoinHostToNetwork,
Host: *currHost,
Node: *newNode,
}); err != nil {
logger.Log(0, r.Header.Get("user"), "failed to update host to join network:", hostid, network, err.Error())
}
networks := logic.GetHostNetworks(currHost.ID.String()) networks := logic.GetHostNetworks(currHost.ID.String())
if len(networks) > 0 { if len(networks) > 0 {
if err = mq.ModifyClient(&mq.MqClient{ if err = mq.ModifyClient(&mq.MqClient{