Skip to content

Commit 6c2d351

Browse files
committed
[SPARK-27626][K8S] Fix docker-image-tool.sh to be robust in non-bash shell env
## What changes were proposed in this pull request? 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)' ``` ## How was this patch tested? Manual. Run the script with non-bash shell environment. ``` bin/docker-image-tool.sh -m -t testing build ``` Closes apache#24517 from dongjoon-hyun/SPARK-27626. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 9a419c3 commit 6c2d351

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/docker-image-tool.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ do
282282
if ! minikube status 1>/dev/null; then
283283
error "Cannot contact minikube. Make sure it's running."
284284
fi
285-
eval $(minikube docker-env)
285+
eval $(minikube docker-env --shell bash)
286286
;;
287287
u) SPARK_UID=${OPTARG};;
288288
esac

0 commit comments

Comments
 (0)