mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
TopologyAwareHints: fix getHintsByZone bug
The bug could result in the EndpointSlice controller unnecessarily updating EndpointSlices associated with a Service that had Topology Aware Hints enabled.
This commit is contained in:
parent
d385d0602a
commit
528cd30145
@ -188,9 +188,13 @@ func getHintsByZone(slice *discovery.EndpointSlice, allocatedHintsByZone Endpoin
|
||||
if endpoint.Hints == nil || len(endpoint.Hints.ForZones) == 0 {
|
||||
return nil
|
||||
}
|
||||
zone := endpoint.Hints.ForZones[0].Name
|
||||
if _, ok := allocations[zone]; ok {
|
||||
return nil
|
||||
|
||||
for i := range endpoint.Hints.ForZones {
|
||||
zone := endpoint.Hints.ForZones[i].Name
|
||||
if _, ok := allocations[zone]; !ok {
|
||||
return nil
|
||||
}
|
||||
hintsByZone[zone]++
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user