fix: docker entrypoint move VGW_ARGS before backend subcommand

Global flags must appear before the backend subcommand in the
versitygw CLI. Previously VGW_ARGS was appended after the backend,
causing global flags to be silently ignored.

Reorder argument assembly to: VGW_ARGS <backend> VGW_BACKEND_ARG VGW_BACKEND_ARGS

Fixes #2082
This commit is contained in:
Ben McClelland
2026-04-22 08:13:11 -07:00
parent 41fc459213
commit 8e8fac6afd
+9 -6
View File
@@ -32,7 +32,15 @@ case "$backend" in
;;
esac
set -- "$backend"
# Global flags must precede the backend subcommand.
if [ -n "${VGW_ARGS:-}" ]; then
# shellcheck disable=SC2086
set -- ${VGW_ARGS}
else
set --
fi
set -- "$@" "$backend"
if [ -n "${VGW_BACKEND_ARG:-}" ]; then
set -- "$@" "$VGW_BACKEND_ARG"
@@ -43,9 +51,4 @@ if [ -n "${VGW_BACKEND_ARGS:-}" ]; then
set -- "$@" ${VGW_BACKEND_ARGS}
fi
if [ -n "${VGW_ARGS:-}" ]; then
# shellcheck disable=SC2086
set -- "$@" ${VGW_ARGS}
fi
exec "$BIN" "$@"