Skip to content

Commit

Permalink
ENH: Sorts tasks ips (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjpfan authored Sep 5, 2018
1 parent a828bc0 commit b597b53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion actions/reconfigure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,8 @@ func (s ReconfigureTestSuite) Test_Execute_WritesServerSession() {
s.reconfigure.AclName = "my-service"
s.reconfigure.ServiceDest[0].Port = "1111"
s.reconfigure.ServiceDest[0].HttpsPort = 2222
s.reconfigure.Tasks = []string{"1.2.3.4", "4.3.2.1"}
// The expectedData will place these ips in order
s.reconfigure.Tasks = []string{"4.3.2.1", "1.2.3.4"}
s.reconfigure.SessionType = "sticky-server"
var actualData string
expectedData := `
Expand Down
3 changes: 3 additions & 0 deletions proxy/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,9 @@ func FormatServiceForTemplates(sr *Service) {
sr.Replicas = len(ips)
}
}

sort.Strings(sr.Tasks)

for i, sd := range sr.ServiceDest {
if len(sr.ServiceDest[i].ReqMode) == 0 {
sr.ServiceDest[i].ReqMode = "http"
Expand Down

0 comments on commit b597b53

Please sign in to comment.