mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Add unit tests for RepackSubsets to take pod UID into consideration
This commit is contained in:
@@ -36,7 +36,7 @@ func RepackSubsets(subsets []api.EndpointSubset) []api.EndpointSubset {
|
||||
// First map each unique port definition to the sets of hosts that
|
||||
// offer it. The sets of hosts must be de-duped, using IP+UID as the key.
|
||||
type addressKey struct {
|
||||
ip string
|
||||
ip string
|
||||
uid types.UID
|
||||
}
|
||||
allAddrs := map[addressKey]*api.EndpointAddress{}
|
||||
@@ -120,10 +120,10 @@ func LessEndpointAddress(a, b *api.EndpointAddress) bool {
|
||||
if ipComparison != 0 {
|
||||
return ipComparison < 0
|
||||
}
|
||||
if (b.TargetRef == nil) {
|
||||
if b.TargetRef == nil {
|
||||
return false
|
||||
}
|
||||
if (a.TargetRef == nil) {
|
||||
if a.TargetRef == nil {
|
||||
return true
|
||||
}
|
||||
return a.TargetRef.UID < b.TargetRef.UID
|
||||
|
||||
Reference in New Issue
Block a user