Skip to content

Commit 97cda4a

Browse files
committed
[supervisor] respond PortsStatus with sorted ports
1 parent 0c805de commit 97cda4a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: components/supervisor/pkg/supervisor/services.go

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"io"
1212
"os"
1313
"path/filepath"
14+
"sort"
1415
"strings"
1516
"sync"
1617
"time"
@@ -227,6 +228,9 @@ func (s *statusService) PortsStatus(req *api.PortsStatusRequest, srv api.StatusS
227228
if update == nil {
228229
return nil
229230
}
231+
sort.SliceStable(update, func(i, j int) bool {
232+
return update[i].LocalPort < update[j].LocalPort
233+
})
230234
err := srv.Send(&api.PortsStatusResponse{
231235
Ports: update,
232236
})

0 commit comments

Comments
 (0)