mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-04 16:33:49 +08:00
publish dns on node creation
This commit is contained in:
@@ -671,6 +671,21 @@ func createNode(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}()
|
||||
//runForceServerUpdate(&data.Node, true)
|
||||
dns := models.DNSUpdate{
|
||||
Action: models.DNSInsert,
|
||||
Address: data.Node.Address.IP.String(),
|
||||
Name: data.Host.Name + data.Node.Network,
|
||||
}
|
||||
go func() {
|
||||
//publish new node dns entry to all nodes on network
|
||||
if err := mq.PublishDNSUpdate(data.Node.Network, dns); err != nil {
|
||||
logger.Log(1, "failed to publish dns update on node creation", err.Error())
|
||||
}
|
||||
//publish add dns records for network to new node
|
||||
if err := mq.PublishAllDNS(&data.Node); err != nil {
|
||||
logger.Log(1, "failed to publish dns update on node creation", err.Error())
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// == EGRESS ==
|
||||
|
Reference in New Issue
Block a user