Skip to content

Commit

Permalink
🐛 Do not try to find a leader with no nodes
Browse files Browse the repository at this point in the history
Fixes: #38
  • Loading branch information
mudler committed Nov 26, 2022
1 parent bf06501 commit 362afe6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/vpn/dhcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ func DHCPNetworkService(ip chan string, l log.StandardLogger, maxTime time.Durat
continue
}

if len(nodesWithNoIP) == 0 {
l.Debug("not enough nodes waiting for IP being announced, sleeping")
continue
}

shouldBeLeader := utils.Leader(nodesWithNoIP)

var lead string
Expand Down

0 comments on commit 362afe6

Please sign in to comment.