This is an automated email from the ASF dual-hosted git repository.

lincoln pushed a commit to branch dev-master
in repository https://gitbox.apache.org/repos/asf/flink-docker.git


The following commit(s) were added to refs/heads/dev-master by this push:
     new dd78da0  [hotfix] Improve docker-entrypoint.sh to Use Arrays for 
Configuration Parameters Instead of Eval and String Concatenation
dd78da0 is described below

commit dd78da0d9c4e5f081156e18aacf8a12b5ee0f7b7
Author: Junrui Lee <[email protected]>
AuthorDate: Tue Mar 19 10:27:47 2024 +0800

    [hotfix] Improve docker-entrypoint.sh to Use Arrays for Configuration 
Parameters Instead of Eval and String Concatenation
    
    This closes #188
---
 docker-entrypoint.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index e884375..e081109 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -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
 }
 

Reply via email to