mirror of
https://github.com/status-im/consul.git
synced 2025-02-16 23:57:07 +00:00
consul: Sort datacenter list. Fixes #198
This commit is contained in:
parent
912908c035
commit
e171df2e2c
@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"github.com/armon/go-metrics"
|
"github.com/armon/go-metrics"
|
||||||
"github.com/hashicorp/consul/consul/structs"
|
"github.com/hashicorp/consul/consul/structs"
|
||||||
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -84,6 +85,9 @@ func (c *Catalog) ListDatacenters(args *struct{}, reply *[]string) error {
|
|||||||
dcs = append(dcs, dc)
|
dcs = append(dcs, dc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort the DCs
|
||||||
|
sort.Strings(dcs)
|
||||||
|
|
||||||
// Return
|
// Return
|
||||||
*reply = dcs
|
*reply = dcs
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user