Use weights from xDS

use the weights as reported. Set prio to 0 to signal it's not used.

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2020-07-24 10:33:52 +02:00
parent 6afcfb8390
commit ccc6e0cff9
4 changed files with 21 additions and 13 deletions

View File

@@ -205,9 +205,9 @@ func (c *Client) Select(cluster string, healty bool) (*SocketAddress, bool) {
}
// All returns all endpoints.
func (c *Client) All(cluster string, healty bool) ([]*SocketAddress, bool) {
func (c *Client) All(cluster string, healty bool) ([]*SocketAddress, []uint32, bool) {
if cluster == "" {
return nil, false
return nil, nil, false
}
return c.assignments.All(cluster, healty)
}