mirror of https://github.com/docker/compose.git
Make `ps` order predictable
so one can run `watch docker ecs compose ps` Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
5080a83242
commit
ff88290302
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"text/tabwriter"
|
||||
|
||||
|
@ -43,6 +44,10 @@ func (c *client) ComposePs(ctx context.Context, project *compose.Project) error
|
|||
return err
|
||||
}
|
||||
|
||||
sort.Slice(tasks, func(i, j int) bool {
|
||||
return strings.Compare(tasks[i].Service, tasks[j].Service) < 0
|
||||
})
|
||||
|
||||
for _, t := range tasks {
|
||||
ports := []string{}
|
||||
s, err := project.GetService(t.Service)
|
||||
|
|
Loading…
Reference in New Issue