Merge pull request #6283 from dokku/remove-deprecated-proxy-code

Remove deprecated proxy-ports functions and and plugin subcommands
This commit is contained in:
Jose Diaz-Gonzalez
2023-10-16 16:38:30 -04:00
committed by GitHub
7 changed files with 6 additions and 94 deletions

View File

@@ -22,3 +22,9 @@
## Removals
- ARM support has been removed. Users of ARM installations on platforms such as the Raspberry PI should consider migrating to ARM64. ARM64 will continue to be supported by Dokku, and there are no plans to remove support for ARM64.
- The following proxy-port related code has been removed. It is replaced by the `ports` plugin and it's related plugin triggers.
- `proxy:ports-*` commands
- `proxy-configure-ports` plugin trigger
- `common#get_available_port()`
- `common#get_dockerfile_exposed_ports()`
- `common#get_exposed_ports_from_image()`

View File

@@ -2194,24 +2194,6 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `proxy-configure-ports`
> [!WARNING]
> Deprecated, please use `ports-configure` instead
- Description: Configures the port mapping
- Invoked by: `internally triggered by proxy plugins`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `proxy-disable`
- Description: Disables the configured proxy implementation for an app

View File

@@ -1 +0,0 @@
hook

View File

@@ -758,12 +758,6 @@ docker_cleanup() {
"$PLUGIN_CORE_AVAILABLE_PATH/common/common" --quiet docker-cleanup "$APP"
}
get_available_port() {
declare desc="returns first currently unused port > 1024"
dokku_log_warn "Deprecated: please use the 'ports-get-available' plugin trigger instead"
plugn trigger ports-get-available
}
dokku_auth() {
declare desc="calls user-auth plugin trigger"
export SSH_USER=${SSH_USER:=$USER}
@@ -827,25 +821,6 @@ get_ipv6_regex() {
echo "${RE_IPV6}\$"
}
get_dockerfile_exposed_ports() {
declare desc="return all exposed ports from passed file path"
dokku_log_warn "Deprecated: this function should not be used in app code"
local DOCKERFILE_PORTS=$(grep -E "^EXPOSE " "$1" | awk '{ print $2 }' | xargs) || true
echo "$DOCKERFILE_PORTS"
}
get_exposed_ports_from_image() {
declare desc="return all exposed ports from passed image name"
dokku_log_warn "Deprecated: this function should not be used in app code"
local IMAGE="$1"
verify_image "$IMAGE"
# shellcheck disable=SC2016
local DOCKER_IMAGE_EXPOSED_PORTS="$("$DOCKER_BIN" image inspect --format '{{range $key, $value := .Config.ExposedPorts}}{{$key}} {{end}}' "$IMAGE")"
echo "$DOCKER_IMAGE_EXPOSED_PORTS"
}
get_entrypoint_from_image() {
declare desc="return .Config.Entrypoint from passed image name"
local IMAGE="$1"

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-ports-proxy-configure-ports() {
declare desc="ports proxy-configure-ports plugin trigger"
declare trigger="proxy-configure-ports"
declare APP="$1"
dokku_log_warn "Deprecated: please use the 'ports-configure' plugin trigger instead"
plugn trigger ports-configure "$APP"
}
trigger-ports-proxy-configure-ports "$@"

View File

@@ -5,7 +5,6 @@ go 1.21
require (
github.com/dokku/dokku/plugins/common v0.0.0-00010101000000-000000000000
github.com/dokku/dokku/plugins/config v0.0.0-00010101000000-000000000000
github.com/dokku/dokku/plugins/ports v0.0.0-00010101000000-000000000000
github.com/spf13/pflag v1.0.5
)

View File

@@ -6,7 +6,6 @@ import (
"strings"
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/ports"
"github.com/dokku/dokku/plugins/proxy"
flag "github.com/spf13/pflag"
@@ -46,39 +45,6 @@ func main() {
args.Parse(os.Args[2:])
appName := args.Arg(0)
err = proxy.CommandEnable(appName, *allApps, *parallelCount)
case "ports":
args := flag.NewFlagSet("proxy:ports", flag.ExitOnError)
args.Parse(os.Args[2:])
appName := args.Arg(0)
common.LogWarn("Deprecated: Use 'ports:list' instead")
err = ports.CommandList(appName)
case "ports-add":
args := flag.NewFlagSet("proxy:ports-add", flag.ExitOnError)
args.Parse(os.Args[2:])
appName := args.Arg(0)
_, portMaps := common.ShiftString(args.Args())
common.LogWarn("Deprecated: Use 'ports:add' instead")
err = ports.CommandAdd(appName, portMaps)
case "ports-clear":
args := flag.NewFlagSet("proxy:ports-clear", flag.ExitOnError)
args.Parse(os.Args[2:])
appName := args.Arg(0)
common.LogWarn("Deprecated: Use 'ports:clear' instead")
err = ports.CommandClear(appName)
case "ports-remove":
args := flag.NewFlagSet("proxy:ports-remove", flag.ExitOnError)
args.Parse(os.Args[2:])
appName := args.Arg(0)
_, portMaps := common.ShiftString(args.Args())
common.LogWarn("Deprecated: Use 'ports:remove' instead")
err = ports.CommandRemove(appName, portMaps)
case "ports-set":
args := flag.NewFlagSet("proxy:ports-set", flag.ExitOnError)
args.Parse(os.Args[2:])
appName := args.Arg(0)
_, portMaps := common.ShiftString(args.Args())
common.LogWarn("Deprecated: Use 'ports:set' instead")
err = ports.CommandSet(appName, portMaps)
case "report":
args := flag.NewFlagSet("proxy:report", flag.ExitOnError)
format := args.String("format", "stdout", "format: [ stdout | json ]")