From 70dde48f5ce27074f786d3e38370128578bffe53 Mon Sep 17 00:00:00 2001 From: Matthias Loibl Date: Fri, 15 Mar 2019 14:58:14 +0100 Subject: [PATCH] Sort peers before returning via API Signed-off-by: Matthias Loibl --- api/v2/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/v2/api.go b/api/v2/api.go index 1ec8bd12..9c82274a 100644 --- a/api/v2/api.go +++ b/api/v2/api.go @@ -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{ Name: api.peer.Name(), Status: &status,