fix fetching uniqueIp

This commit is contained in:
Abhishek Kondur
2023-01-13 19:11:40 +05:30
parent f129316bfe
commit e9dd9ac0a4
5 changed files with 53 additions and 20 deletions

View File

@@ -971,6 +971,17 @@ func updateNode(w http.ResponseWriter, r *http.Request) {
}
}
}
host, err := logic.GetHost(newNode.HostID.String())
if err != nil {
logger.Log(0, r.Header.Get("user"),
fmt.Sprintf("failed to get host for node [ %s ] info: %v", nodeid, err))
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal"))
return
}
if newNode.IsIngressGateway {
host.ProxyEnabled = true
logic.UpsertHost(host)
}
relayedUpdate := false
if currentNode.IsRelayed && (currentNode.Address.String() != newNode.Address.String() || currentNode.Address6.String() != newNode.Address6.String()) {
relayedUpdate = true