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:
Jose Diaz-Gonzalez
2023-07-02 01:29:01 -04:00
parent a0b84d52ef
commit 64f0f2674d
43 changed files with 894 additions and 553 deletions

View File

@@ -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, " ")
}