fix: expired peer missing in peer list

This commit is contained in:
Johan Siebens
2024-02-10 15:36:28 +01:00
parent 0eef9faf86
commit 41b64eed71
4 changed files with 44 additions and 3 deletions
+11
View File
@@ -66,6 +66,17 @@ func PeerCount(expected int) Condition {
}
}
func HasExpiredPeer(name string) Condition {
return func(status *ipnstate.Status) bool {
for _, peer := range status.Peer {
if strings.HasPrefix(peer.DNSName, name) {
return peer.Expired
}
}
return false
}
}
func HasCapability(capability tailcfg.NodeCapability) Condition {
return func(status *ipnstate.Status) bool {
self := status.Self