fix: ensure proxy ports are sorted

This commit is contained in:
Jose Diaz-Gonzalez
2020-02-25 21:14:37 -05:00
parent 05486d6df1
commit 3f85b682fb

View File

@@ -4,6 +4,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"os" "os"
"sort"
"strconv" "strconv"
"strings" "strings"
@@ -120,6 +121,7 @@ func listAppProxyPorts(appName string) error {
lines = append(lines, portMap.String()) lines = append(lines, portMap.String())
} }
sort.Strings(lines)
common.LogInfo1Quiet(fmt.Sprintf("Port mappings for %s", appName)) common.LogInfo1Quiet(fmt.Sprintf("Port mappings for %s", appName))
config := columnize.DefaultConfig() config := columnize.DefaultConfig()
config.Delim = ":" config.Delim = ":"
@@ -135,6 +137,7 @@ func setProxyPorts(appName string, proxyPortMap []PortMap) error {
value = append(value, portMap.String()) value = append(value, portMap.String())
} }
sort.Strings(value)
entries := map[string]string{ entries := map[string]string{
"DOKKU_PROXY_PORT_MAP": strings.Join(value, " "), "DOKKU_PROXY_PORT_MAP": strings.Join(value, " "),
} }