mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-04 19:05:27 +08:00
add node to zombie list after expiration
This commit is contained in:
parent
6e50011ceb
commit
d8fe0b5194
1 changed files with 2 additions and 1 deletions
|
@ -25,6 +25,7 @@ var (
|
|||
|
||||
// CheckZombies - checks if new node has same macaddress as existing node
|
||||
// if so, existing node is added to zombie node quarantine list
|
||||
// also cleans up nodes past their expiration date
|
||||
func CheckZombies(newnode *models.Node, mac net.HardwareAddr) {
|
||||
nodes, err := GetNetworkNodes(newnode.Network)
|
||||
if err != nil {
|
||||
|
@ -37,7 +38,7 @@ func CheckZombies(newnode *models.Node, mac net.HardwareAddr) {
|
|||
// should we delete the node if host not found ??
|
||||
continue
|
||||
}
|
||||
if host.MacAddress.String() == mac.String() {
|
||||
if host.MacAddress.String() == mac.String() || time.Now().After(node.ExpirationDateTime) {
|
||||
logger.Log(0, "adding ", node.ID.String(), " to zombie list")
|
||||
newZombie <- node.ID
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue