diff --git a/docs/appendices/0.32.0-migration-guide.md b/docs/appendices/0.32.0-migration-guide.md index 762bccf29..9775e01d1 100644 --- a/docs/appendices/0.32.0-migration-guide.md +++ b/docs/appendices/0.32.0-migration-guide.md @@ -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()` diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index c1f2f6ce8..307031d77 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -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 diff --git a/plugins/20_events/proxy-configure-ports b/plugins/20_events/proxy-configure-ports deleted file mode 120000 index 5178a749f..000000000 --- a/plugins/20_events/proxy-configure-ports +++ /dev/null @@ -1 +0,0 @@ -hook \ No newline at end of file diff --git a/plugins/common/functions b/plugins/common/functions index b9dd37dc0..7359a980a 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -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" diff --git a/plugins/ports/proxy-configure-ports b/plugins/ports/proxy-configure-ports deleted file mode 100755 index 649106588..000000000 --- a/plugins/ports/proxy-configure-ports +++ /dev/null @@ -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 "$@" diff --git a/plugins/proxy/go.mod b/plugins/proxy/go.mod index 8db0b2699..44b074df4 100644 --- a/plugins/proxy/go.mod +++ b/plugins/proxy/go.mod @@ -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 ) diff --git a/plugins/proxy/src/subcommands/subcommands.go b/plugins/proxy/src/subcommands/subcommands.go index 0dd972857..d181068da 100644 --- a/plugins/proxy/src/subcommands/subcommands.go +++ b/plugins/proxy/src/subcommands/subcommands.go @@ -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 ]")