edsbalancer: fix address format (#2675)
This commit is contained in:
@ -21,7 +21,9 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
xdspb "github.com/envoyproxy/go-control-plane/envoy/api/v2"
|
xdspb "github.com/envoyproxy/go-control-plane/envoy/api/v2"
|
||||||
@ -206,7 +208,7 @@ func (xdsB *EDSBalancer) HandleEDSResponse(edsResp *xdspb.ClusterLoadAssignment)
|
|||||||
for _, lbEndpoint := range locality.GetLbEndpoints() {
|
for _, lbEndpoint := range locality.GetLbEndpoints() {
|
||||||
socketAddress := lbEndpoint.GetEndpoint().GetAddress().GetSocketAddress()
|
socketAddress := lbEndpoint.GetEndpoint().GetAddress().GetSocketAddress()
|
||||||
newAddrs = append(newAddrs, resolver.Address{
|
newAddrs = append(newAddrs, resolver.Address{
|
||||||
Addr: fmt.Sprintf("%s:%d", socketAddress.GetAddress(), socketAddress.GetPortValue()),
|
Addr: net.JoinHostPort(socketAddress.GetAddress(), strconv.Itoa(int(socketAddress.GetPortValue()))),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
var weightChanged, addrsChanged bool
|
var weightChanged, addrsChanged bool
|
||||||
|
Reference in New Issue
Block a user