refactor: move all port management code to standalone ports plugin
This change makes interacting with port mappings more clear - folks might previously set the port mapping to the proxy type or vice-versa. The existing proxy:ports* commands still exist but will show a deprecation warning for a single minor release.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
)
|
||||
|
||||
@@ -13,9 +11,8 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
|
||||
}
|
||||
|
||||
flags := map[string]common.ReportFunc{
|
||||
"--proxy-enabled": reportEnabled,
|
||||
"--proxy-type": reportType,
|
||||
"--proxy-port-map": reportPortMap,
|
||||
"--proxy-enabled": reportEnabled,
|
||||
"--proxy-type": reportType,
|
||||
}
|
||||
|
||||
flagKeys := []string{}
|
||||
@@ -41,12 +38,3 @@ func reportEnabled(appName string) string {
|
||||
func reportType(appName string) string {
|
||||
return getAppProxyType(appName)
|
||||
}
|
||||
|
||||
func reportPortMap(appName string) string {
|
||||
var proxyPortMap []string
|
||||
for _, portMap := range getProxyPortMap(appName) {
|
||||
proxyPortMap = append(proxyPortMap, portMap.String())
|
||||
}
|
||||
|
||||
return strings.Join(proxyPortMap, " ")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user