refactor: rename functions to be plural
They are plural for the scheduler-k3s plugin.
This commit is contained in:
@@ -5,28 +5,28 @@ source "$PLUGIN_AVAILABLE_PATH/caddy-vhosts/internal-functions"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
cmd-caddy-label-add() {
|
||||
cmd-caddy-labels-add() {
|
||||
declare desc="adds container label to app for specified proxy"
|
||||
declare cmd="caddy:label:add"
|
||||
declare cmd="caddy:labels:add"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-add "proxy:label:add" "caddy" "$@"
|
||||
cmd-proxy-labels-add "proxy:labels:add" "caddy" "$@"
|
||||
}
|
||||
|
||||
cmd-caddy-label-remove() {
|
||||
cmd-caddy-labels-remove() {
|
||||
declare desc="removes container label from app for specified proxy"
|
||||
declare cmd="caddy:label:remove"
|
||||
declare cmd="caddy:labels:remove"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-remove "proxy:label:remove" "caddy" "$@"
|
||||
cmd-proxy-labels-remove "proxy:labels:remove" "caddy" "$@"
|
||||
}
|
||||
|
||||
cmd-caddy-label-show() {
|
||||
cmd-caddy-labels-show() {
|
||||
declare desc="shows container labels for app for specified proxy"
|
||||
declare cmd="caddy:label:show"
|
||||
declare cmd="caddy:labels:show"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-show "proxy:label:show" "caddy" "$@"
|
||||
cmd-proxy-labels-show "proxy:labels:show" "caddy" "$@"
|
||||
}
|
||||
|
||||
cmd-caddy-report() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
[[ " caddy:help caddy:label:add caddy:label:remove caddy:label:show help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
[[ " caddy:help caddy:labels:add caddy:labels:remove caddy:labels:show help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
source "$PLUGIN_AVAILABLE_PATH/caddy-vhosts/help-functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/caddy-vhosts/command-functions"
|
||||
set -eo pipefail
|
||||
@@ -10,16 +10,16 @@ case "$1" in
|
||||
cmd-caddy-help "$@"
|
||||
;;
|
||||
|
||||
caddy:label:add)
|
||||
cmd-caddy-label-add "$@"
|
||||
caddy:labels:add)
|
||||
cmd-caddy-labels-add "$@"
|
||||
;;
|
||||
|
||||
caddy:label:remove)
|
||||
cmd-caddy-label-remove "$@"
|
||||
caddy:labels:remove)
|
||||
cmd-caddy-labels-remove "$@"
|
||||
;;
|
||||
|
||||
caddy:label:show)
|
||||
cmd-caddy-label-show "$@"
|
||||
caddy:labels:show)
|
||||
cmd-caddy-labels-show "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
@@ -30,9 +30,9 @@ fn-help-content() {
|
||||
caddy:report [<app>] [<flag>], Displays an caddy report for one or more apps
|
||||
caddy:set <app> <property> (<value>), Set or clear an caddy property for an app
|
||||
caddy:show-config <app>, Display caddy compose config
|
||||
caddy:label:add <app> <label> <value>, Add a label to an caddy app
|
||||
caddy:label:remove <app> <label>, Remove a label from an caddy app
|
||||
caddy:label:show <app> [<label>], Show labels for an caddy app
|
||||
caddy:labels:add <app> <label> <value>, Add a label to an caddy app
|
||||
caddy:labels:remove <app> <label>, Remove a label from an caddy app
|
||||
caddy:labels:show <app> [<label>], Show labels for an caddy app
|
||||
caddy:start, Starts the caddy server
|
||||
caddy:stop, Stops the caddy server
|
||||
help_content
|
||||
|
||||
@@ -5,28 +5,28 @@ source "$PLUGIN_AVAILABLE_PATH/haproxy-vhosts/internal-functions"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
cmd-haproxy-label-add() {
|
||||
cmd-haproxy-labels-add() {
|
||||
declare desc="adds container label to app for specified proxy"
|
||||
declare cmd="haproxy:label:add"
|
||||
declare cmd="haproxy:labels:add"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-add "proxy:label:add" "haproxy" "$@"
|
||||
cmd-proxy-labels-add "proxy:labels:add" "haproxy" "$@"
|
||||
}
|
||||
|
||||
cmd-haproxy-label-remove() {
|
||||
cmd-haproxy-labels-remove() {
|
||||
declare desc="removes container label from app for specified proxy"
|
||||
declare cmd="haproxy:label:remove"
|
||||
declare cmd="haproxy:labels:remove"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-remove "proxy:label:remove" "haproxy" "$@"
|
||||
cmd-proxy-labels-remove "proxy:labels:remove" "haproxy" "$@"
|
||||
}
|
||||
|
||||
cmd-haproxy-label-show() {
|
||||
cmd-haproxy-labels-show() {
|
||||
declare desc="shows container labels for app for specified proxy"
|
||||
declare cmd="haproxy:label:show"
|
||||
declare cmd="haproxy:labels:show"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-show "proxy:label:show" "haproxy" "$@"
|
||||
cmd-proxy-labels-show "proxy:labels:show" "haproxy" "$@"
|
||||
}
|
||||
|
||||
cmd-haproxy-report() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
[[ " haproxy:help haproxy:label:add haproxy:label:remove haproxy:label:show help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
[[ " haproxy:help haproxy:labels:add haproxy:labels:remove haproxy:labels:show help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
source "$PLUGIN_AVAILABLE_PATH/haproxy-vhosts/help-functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/haproxy-vhosts/command-functions"
|
||||
set -eo pipefail
|
||||
@@ -10,16 +10,16 @@ case "$1" in
|
||||
cmd-haproxy-help "$@"
|
||||
;;
|
||||
|
||||
haproxy:label:add)
|
||||
cmd-haproxy-label-add "$@"
|
||||
haproxy:labels:add)
|
||||
cmd-haproxy-labels-add "$@"
|
||||
;;
|
||||
|
||||
haproxy:label:remove)
|
||||
cmd-haproxy-label-remove "$@"
|
||||
haproxy:labels:remove)
|
||||
cmd-haproxy-labels-remove "$@"
|
||||
;;
|
||||
|
||||
haproxy:label:show)
|
||||
cmd-haproxy-label-show "$@"
|
||||
haproxy:labels:show)
|
||||
cmd-haproxy-labels-show "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
@@ -30,9 +30,9 @@ fn-help-content() {
|
||||
haproxy:report [<app>] [<flag>], Displays an haproxy report for one or more apps
|
||||
haproxy:set <app> <property> (<value>), Set or clear an haproxy property for an app
|
||||
haproxy:show-config <app>, Display haproxy compose config
|
||||
haproxy:label:add <app> <label> <value>, Add a label to an haproxy app
|
||||
haproxy:label:remove <app> <label>, Remove a label from an haproxy app
|
||||
haproxy:label:show <app> [<label>], Show labels for an haproxy app
|
||||
haproxy:labels:add <app> <label> <value>, Add a label to an haproxy app
|
||||
haproxy:labels:remove <app> <label>, Remove a label from an haproxy app
|
||||
haproxy:labels:show <app> [<label>], Show labels for an haproxy app
|
||||
haproxy:start, Starts the haproxy server
|
||||
haproxy:stop, Stops the haproxy server
|
||||
help_content
|
||||
|
||||
@@ -5,28 +5,28 @@ source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/internal-functions"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
cmd-openresty-label-add() {
|
||||
cmd-openresty-labels-add() {
|
||||
declare desc="adds container label to app for specified proxy"
|
||||
declare cmd="openresty:label:add"
|
||||
declare cmd="openresty:labels:add"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-add "proxy:label:add" "openresty" "$@"
|
||||
cmd-proxy-labels-add "proxy:labels:add" "openresty" "$@"
|
||||
}
|
||||
|
||||
cmd-openresty-label-remove() {
|
||||
cmd-openresty-labels-remove() {
|
||||
declare desc="removes container label from app for specified proxy"
|
||||
declare cmd="openresty:label:remove"
|
||||
declare cmd="openresty:labels:remove"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-remove "proxy:label:remove" "openresty" "$@"
|
||||
cmd-proxy-labels-remove "proxy:labels:remove" "openresty" "$@"
|
||||
}
|
||||
|
||||
cmd-openresty-label-show() {
|
||||
cmd-openresty-labels-show() {
|
||||
declare desc="shows container labels for app for specified proxy"
|
||||
declare cmd="openresty:label:show"
|
||||
declare cmd="openresty:labels:show"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-show "proxy:label:show" "openresty" "$@"
|
||||
cmd-proxy-labels-show "proxy:labels:show" "openresty" "$@"
|
||||
}
|
||||
|
||||
cmd-openresty-report() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
[[ " openresty:help openresty:label:add openresty:label:remove openresty:label:show help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
[[ " openresty:help openresty:labels:add openresty:labels:remove openresty:labels:show help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/help-functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/command-functions"
|
||||
set -eo pipefail
|
||||
@@ -10,16 +10,16 @@ case "$1" in
|
||||
cmd-openresty-help "$@"
|
||||
;;
|
||||
|
||||
openresty:label:add)
|
||||
cmd-openresty-label-add "$@"
|
||||
openresty:labels:add)
|
||||
cmd-openresty-labels-add "$@"
|
||||
;;
|
||||
|
||||
openresty:label:remove)
|
||||
cmd-openresty-label-remove "$@"
|
||||
openresty:labels:remove)
|
||||
cmd-openresty-labels-remove "$@"
|
||||
;;
|
||||
|
||||
openresty:label:show)
|
||||
cmd-openresty-label-show "$@"
|
||||
openresty:labels:show)
|
||||
cmd-openresty-labels-show "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
@@ -30,9 +30,9 @@ fn-help-content() {
|
||||
openresty:report [<app>] [<flag>], Displays an openresty report for one or more apps
|
||||
openresty:set <app> <property> (<value>), Set or clear an openresty property for an app
|
||||
openresty:show-config <app>, Display openresty compose config
|
||||
openresty:label:add <app> <label> <value>, Add a label to an openresty app
|
||||
openresty:label:remove <app> <label>, Remove a label from an openresty app
|
||||
openresty:label:show <app> [<label>], Show labels for an openresty app
|
||||
openresty:labels:add <app> <label> <value>, Add a label to an openresty app
|
||||
openresty:labels:remove <app> <label>, Remove a label from an openresty app
|
||||
openresty:labels:show <app> [<label>], Show labels for an openresty app
|
||||
openresty:start, Starts the openresty server
|
||||
openresty:stop, Stops the openresty server
|
||||
help_content
|
||||
|
||||
@@ -4,9 +4,9 @@ source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
cmd-proxy-label-show() {
|
||||
cmd-proxy-labels-show() {
|
||||
declare desc="show a proxy label for an app"
|
||||
declare cmd="proxy:label:show"
|
||||
declare cmd="proxy:labels:show"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare PROXY="$1" APP="$2" PASSED_LABEL_NAME="$3"
|
||||
shift 2
|
||||
@@ -22,9 +22,9 @@ cmd-proxy-label-show() {
|
||||
fn-proxy-display-labels "$PROXY" "$APP"
|
||||
}
|
||||
|
||||
cmd-proxy-label-add() {
|
||||
cmd-proxy-labels-add() {
|
||||
declare desc="adds container label to app for specified proxy"
|
||||
declare cmd="proxy:label:add"
|
||||
declare cmd="proxy:labels:add"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare PROXY="$1" APP="$2" PASSED_LABEL_NAME="$3" PASSED_LABEL_VALUE="$4"
|
||||
|
||||
@@ -35,15 +35,15 @@ cmd-proxy-label-add() {
|
||||
|
||||
local proxy_labels_file_path="$(fn-proxy-get-labels-file-path "$PROXY" "$APP")"
|
||||
touch "$proxy_labels_file_path"
|
||||
cmd-proxy-label-remove "$PROXY" "$APP" "$PASSED_LABEL_NAME" >/dev/null
|
||||
cmd-proxy-labels-remove "$PROXY" "$APP" "$PASSED_LABEL_NAME" >/dev/null
|
||||
echo "--label '${PASSED_LABEL_NAME}=${PASSED_LABEL_VALUE}' " >>"$proxy_labels_file_path"
|
||||
local all_proxy_labels="$(<"$proxy_labels_file_path")"
|
||||
echo -e "${all_proxy_labels}" | sed '/^$/d' | sort -u >"$proxy_labels_file_path"
|
||||
}
|
||||
|
||||
cmd-proxy-label-remove() {
|
||||
cmd-proxy-labels-remove() {
|
||||
declare desc="removes container label from app for specified proxy"
|
||||
declare cmd="proxy:label:remove"
|
||||
declare cmd="proxy:labels:remove"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare PROXY="$1" APP="$2" PASSED_LABEL_NAME="$3"
|
||||
|
||||
|
||||
@@ -5,28 +5,28 @@ source "$PLUGIN_AVAILABLE_PATH/traefik-vhosts/internal-functions"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
cmd-traefik-label-add() {
|
||||
cmd-traefik-labels-add() {
|
||||
declare desc="adds container label to app for specified proxy"
|
||||
declare cmd="traefik:label:add"
|
||||
declare cmd="traefik:labels:add"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-add "proxy:label:add" "traefik" "$@"
|
||||
cmd-proxy-labels-add "proxy:labels:add" "traefik" "$@"
|
||||
}
|
||||
|
||||
cmd-traefik-label-remove() {
|
||||
cmd-traefik-labels-remove() {
|
||||
declare desc="removes container label from app for specified proxy"
|
||||
declare cmd="traefik:label:remove"
|
||||
declare cmd="traefik:labels:remove"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-remove "proxy:label:remove" "traefik" "$@"
|
||||
cmd-proxy-labels-remove "proxy:labels:remove" "traefik" "$@"
|
||||
}
|
||||
|
||||
cmd-traefik-label-show() {
|
||||
cmd-traefik-labels-show() {
|
||||
declare desc="shows container labels for app for specified proxy"
|
||||
declare cmd="traefik:label:show"
|
||||
declare cmd="traefik:labels:show"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
|
||||
cmd-proxy-label-show "proxy:label:show" "traefik" "$@"
|
||||
cmd-proxy-labels-show "proxy:labels:show" "traefik" "$@"
|
||||
}
|
||||
|
||||
cmd-traefik-report() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
[[ " traefik:help traefik:label:add traefik:label:remove traefik:label:show help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
[[ " traefik:help traefik:labels:add traefik:labels:remove traefik:labels:show help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||
source "$PLUGIN_AVAILABLE_PATH/traefik-vhosts/help-functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/traefik-vhosts/command-functions"
|
||||
set -eo pipefail
|
||||
@@ -10,16 +10,16 @@ case "$1" in
|
||||
cmd-traefik-help "$@"
|
||||
;;
|
||||
|
||||
traefik:label:add)
|
||||
cmd-traefik-label-add "$@"
|
||||
traefik:labels:add)
|
||||
cmd-traefik-labels-add "$@"
|
||||
;;
|
||||
|
||||
traefik:label:remove)
|
||||
cmd-traefik-label-remove "$@"
|
||||
traefik:labels:remove)
|
||||
cmd-traefik-labels-remove "$@"
|
||||
;;
|
||||
|
||||
traefik:label:show)
|
||||
cmd-traefik-label-show "$@"
|
||||
traefik:labels:show)
|
||||
cmd-traefik-labels-show "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
@@ -30,9 +30,9 @@ fn-help-content() {
|
||||
traefik:report [<app>] [<flag>], Displays an traefik report for one or more apps
|
||||
traefik:set <app> <property> (<value>), Set or clear an traefik property for an app
|
||||
traefik:show-config <app>, Display traefik compose config
|
||||
traefik:label:add <app> <label> <value>, Add a label to an traefik app
|
||||
traefik:label:remove <app> <label>, Remove a label from an traefik app
|
||||
traefik:label:show <app> [<label>], Show labels for an traefik app
|
||||
traefik:labels:add <app> <label> <value>, Add a label to an traefik app
|
||||
traefik:labels:remove <app> <label>, Remove a label from an traefik app
|
||||
traefik:labels:show <app> [<label>], Show labels for an traefik app
|
||||
traefik:start, Starts the traefik server
|
||||
traefik:stop, Stops the traefik server
|
||||
help_content
|
||||
|
||||
Reference in New Issue
Block a user