From 8e8fac6afd791964e7f93b761da8d30d4990c34c Mon Sep 17 00:00:00 2001 From: Ben McClelland Date: Wed, 22 Apr 2026 08:13:11 -0700 Subject: [PATCH] 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 VGW_BACKEND_ARG VGW_BACKEND_ARGS Fixes #2082 --- docker-entrypoint.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 3688a656..b4523674 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -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" "$@"