Merge pull request #1800 from metalmatze/sort-peers

Sort peers before returning via API
This commit is contained in:
Max Inden 2019-03-29 08:54:16 +01:00 committed by GitHub
commit 19ab388d93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -172,6 +172,10 @@ func (api *API) getStatusHandler(params general_ops.GetStatusParams) middleware.
}) })
} }
sort.Slice(peers, func(i, j int) bool {
return *peers[i].Name < *peers[j].Name
})
resp.Cluster = &open_api_models.ClusterStatus{ resp.Cluster = &open_api_models.ClusterStatus{
Name: api.peer.Name(), Name: api.peer.Name(),
Status: &status, Status: &status,