refactor: rename functions to be plural

They are plural for the scheduler-k3s plugin.
This commit is contained in:
Jose Diaz-Gonzalez
2025-11-16 18:12:28 -05:00
parent d9073272df
commit d212fd44c7
21 changed files with 139 additions and 139 deletions

View File

@@ -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() {

View File

@@ -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 "$@"
;;
*)

View File

@@ -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