Explorar o código

Merge pull request #4700 from erikh/2371-sort_ports

In `docker ps`, sort by port instead of unsorted.
Victor Vieux %!s(int64=11) %!d(string=hai) anos
pai
achega
a9ac35cbfb
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      api/common.go

+ 2 - 0
api/common.go

@@ -25,6 +25,8 @@ func ValidateHost(val string) (string, error) {
 //TODO remove, used on < 1.5 in getContainersJSON
 func displayablePorts(ports *engine.Table) string {
 	result := []string{}
+	ports.SetKey("PublicPort")
+	ports.Sort()
 	for _, port := range ports.Data {
 		if port.Get("IP") == "" {
 			result = append(result, fmt.Sprintf("%d/%s", port.GetInt("PublicPort"), port.Get("Type")))