Skip to content

Commit

Permalink
[hotfix] Improve docker-entrypoint.sh to Use Arrays for Configuration…
Browse files Browse the repository at this point in the history
… Parameters Instead of Eval and String Concatenation

This closes #188
  • Loading branch information
JunRuiLee authored Mar 19, 2024
1 parent 66a2fdf commit dd78da0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ set_config_options() {
local bin_dir="$FLINK_HOME/bin"
local lib_dir="$FLINK_HOME/lib"

local config_params=""
local config_params=()

while [ $# -gt 0 ]; do
local key="$1"
local value="$2"

config_params+=" -D${key}=${value}"
config_params+=("-D${key}=${value}")

shift 2
done

if [ ! -z "${config_params}" ]; then
eval "${config_parser_script} ${config_dir} ${bin_dir} ${lib_dir} ${config_params}"
if [ "${#config_params[@]}" -gt 0 ]; then
"${config_parser_script}" "${config_dir}" "${bin_dir}" "${lib_dir}" "${config_params[@]}"
fi
}

Expand Down

0 comments on commit dd78da0

Please sign in to comment.