File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
10
10
"net/netip"
11
11
"net/url"
12
12
"reflect"
13
+ "sort"
13
14
"strconv"
14
15
"sync"
15
16
"time"
@@ -402,6 +403,9 @@ func (u *updater) createPeerUpdateLocked(update tailnet.WorkspaceUpdate) *PeerUp
402
403
for name := range agent .Hosts {
403
404
fqdn = append (fqdn , name .WithTrailingDot ())
404
405
}
406
+ sort .Slice (fqdn , func (i , j int ) bool {
407
+ return len (fqdn [i ]) < len (fqdn [j ])
408
+ })
405
409
out .DeletedAgents [i ] = & Agent {
406
410
Id : tailnet .UUIDToByteSlice (agent .ID ),
407
411
Name : agent .Name ,
@@ -424,6 +428,9 @@ func (u *updater) convertAgentsLocked(agents []*tailnet.Agent) []*Agent {
424
428
for name := range agent .Hosts {
425
429
fqdn = append (fqdn , name .WithTrailingDot ())
426
430
}
431
+ sort .Slice (fqdn , func (i , j int ) bool {
432
+ return len (fqdn [i ]) < len (fqdn [j ])
433
+ })
427
434
protoAgent := & Agent {
428
435
Id : tailnet .UUIDToByteSlice (agent .ID ),
429
436
Name : agent .Name ,
You can’t perform that action at this time.
0 commit comments