You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2019/05/03 17:15:12 UTC

[spark] branch branch-2.4 updated: [SPARK-27626][K8S] Fix `docker-image-tool.sh` to be robust in non-bash shell env

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

dongjoon pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new f29da6b  [SPARK-27626][K8S] Fix `docker-image-tool.sh` to be robust in non-bash shell env
f29da6b is described below

commit f29da6bbcbb51c172a11428b7a9aac32b8a95c40
Author: Dongjoon Hyun <dh...@apple.com>
AuthorDate: Fri May 3 10:13:22 2019 -0700

    [SPARK-27626][K8S] Fix `docker-image-tool.sh` to be robust in non-bash shell env
    
    Although we use shebang `#!/usr/bin/env bash`, `minikube docker-env` returns invalid commands in `non-bash` environment and causes failures at `eval` because it only recognizes the default shell. We had better add `--shell bash` option explicitly in our `bash` script.
    
    ```bash
    $ bash -c 'eval $(minikube docker-env)'
    bash: line 0: set: -g: invalid option
    set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
    bash: line 0: set: -g: invalid option
    set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
    bash: line 0: set: -g: invalid option
    set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
    bash: line 0: set: -g: invalid option
    set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
    
    $ bash -c 'eval $(minikube docker-env --shell bash)'
    ```
    
    Manual. Run the script with non-bash shell environment.
    ```
    bin/docker-image-tool.sh -m -t testing build
    ```
    
    Closes #24517 from dongjoon-hyun/SPARK-27626.
    
    Authored-by: Dongjoon Hyun <dh...@apple.com>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
    (cherry picked from commit 6c2d351f5466d42c4d227f5627bd3709c266b5ce)
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 bin/docker-image-tool.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/docker-image-tool.sh b/bin/docker-image-tool.sh
index 5e8eaff..e26da80 100755
--- a/bin/docker-image-tool.sh
+++ b/bin/docker-image-tool.sh
@@ -160,7 +160,7 @@ do
    if ! which minikube 1>/dev/null; then
      error "Cannot find minikube."
    fi
-   eval $(minikube docker-env)
+   eval $(minikube docker-env --shell bash)
    ;;
  esac
 done


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org