mirror of https://github.com/status-im/consul.git
Stable sort cidr ranges to match on
This commit is contained in:
parent
02f6768cd2
commit
c6d64a8078
|
@ -192,6 +192,12 @@ func (s *Server) listenersFromSnapshotConnectProxy(cInfo connectionInfo, cfgSnap
|
|||
PrefixLen: &wrappers.UInt32Value{Value: pfxLen},
|
||||
})
|
||||
}
|
||||
|
||||
// The match rules are stable sorted to avoid draining if the list is provided out of order
|
||||
sort.SliceStable(ranges, func(i, j int) bool {
|
||||
return ranges[i].AddressPrefix < ranges[j].AddressPrefix
|
||||
})
|
||||
|
||||
filterChain.FilterChainMatch = &envoy_listener_v3.FilterChainMatch{
|
||||
PrefixRanges: ranges,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue