fixed another reload bug
This commit is contained in:
parent
ec57e1174c
commit
8672452033
1 changed files with 9 additions and 1 deletions
|
|
@ -1,6 +1,9 @@
|
|||
package haproxy
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
"sort"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
LoadBalancers []*LoadBalancer
|
||||
|
|
@ -15,6 +18,11 @@ func NewConfig(m map[string][]byte) (c Config, err error) {
|
|||
}
|
||||
c.LoadBalancers = append(c.LoadBalancers, lb)
|
||||
}
|
||||
if len(c.LoadBalancers) > 1 {
|
||||
sort.SliceStable(c.LoadBalancers, func(i, j int) bool {
|
||||
return c.LoadBalancers[i].Name < c.LoadBalancers[j].Name
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue