mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #423 from claire921/onpudate
pkg/proxy: filtering before comparing
This commit is contained in:
commit
89655584eb
@ -84,9 +84,10 @@ func (impl LoadBalancerRR) OnUpdate(endpoints []api.Endpoints) {
|
||||
// First update / add all new endpoints for services.
|
||||
for _, value := range endpoints {
|
||||
existingEndpoints, exists := impl.endpointsMap[value.Name]
|
||||
if !exists || !reflect.DeepEqual(value.Endpoints, existingEndpoints) {
|
||||
validEndpoints := impl.FilterValidEndpoints(value.Endpoints)
|
||||
if !exists || !reflect.DeepEqual(existingEndpoints, validEndpoints) {
|
||||
glog.Infof("LoadBalancerRR: Setting endpoints for %s to %+v", value.Name, value.Endpoints)
|
||||
impl.endpointsMap[value.Name] = impl.FilterValidEndpoints(value.Endpoints)
|
||||
impl.endpointsMap[value.Name] = validEndpoints
|
||||
// Start RR from the beginning if added or updated.
|
||||
impl.rrIndex[value.Name] = 0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user