@@ -248,8 +248,11 @@ func (b *clusterResolverBalancer) updateChildConfig() {
248248 b .logger .Infof ("Built child policy config: %s" , pretty .ToJSON (childCfg ))
249249 }
250250
251+ newEndpoints := make ([]resolver.Endpoint , len (endpoints ))
251252 flattenedAddrs := make ([]resolver.Address , len (endpoints ))
252- for i := range endpoints {
253+ for i , e := range endpoints {
254+ newEP := e
255+ newEP .Addresses = make ([]resolver.Address , len (e .Addresses ))
253256 for j := range endpoints [i ].Addresses {
254257 addr := endpoints [i ].Addresses [j ]
255258 addr .BalancerAttributes = endpoints [i ].Attributes
@@ -268,12 +271,13 @@ func (b *clusterResolverBalancer) updateChildConfig() {
268271 // address used by the transport. This workaround can be removed once
269272 // the old pickfirst is removed.
270273 // See https://github.com/grpc/grpc-go/issues/7339
271- endpoints [ i ] .Addresses [j ] = addr
274+ newEP .Addresses [j ] = addr
272275 }
276+ newEndpoints [i ] = newEP
273277 }
274278 if err := b .child .UpdateClientConnState (balancer.ClientConnState {
275279 ResolverState : resolver.State {
276- Endpoints : endpoints ,
280+ Endpoints : newEndpoints ,
277281 Addresses : flattenedAddrs ,
278282 ServiceConfig : b .configRaw ,
279283 Attributes : b .attrsWithClient ,
0 commit comments