Repository: zeppelin Updated Branches: refs/heads/master edf3c2589 -> aa3ea6869
ZEPPELIN-3395 Fix impersonate spark interpreter without proxy-user option ### What is this PR for? Fix impersonate spark interpreter. Currently, impersonate spark interpreter always runs as zeppelin user, not impersonated user when disable proxy-user option. ### What type of PR is it? Bug Fix ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-3395 ### How should this be tested? 1. ZEPPELIN_IMPERSONATE_SPARK_PROXY_USER=false in zeppelin-env.sh 2. set up user impersonation flag 3. run some job using that spark interpreter 4. spark interpreter process should be created with currently logged-in user ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: iijima_satoshi <iijima_sato...@cyberagent.co.jp> Closes #2916 from iijima-satoshi/fix-impersonate-spark and squashes the following commits: a7465b6 [iijima_satoshi] Fix: Spark interpreter does not run as impersonated user when disable proxy-user option Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/aa3ea686 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/aa3ea686 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/aa3ea686 Branch: refs/heads/master Commit: aa3ea6869f336f7a09e6a57bd2882216d010955d Parents: edf3c25 Author: iijima_satoshi <iijima_sato...@cyberagent.co.jp> Authored: Mon Apr 9 21:24:34 2018 +0900 Committer: Jeff Zhang <zjf...@apache.org> Committed: Mon Apr 16 16:58:56 2018 +0800 ---------------------------------------------------------------------- bin/interpreter.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/aa3ea686/bin/interpreter.sh ---------------------------------------------------------------------- diff --git a/bin/interpreter.sh b/bin/interpreter.sh index 45ee0ce..a8375af 100755 --- a/bin/interpreter.sh +++ b/bin/interpreter.sh @@ -205,7 +205,8 @@ fi addJarInDirForIntp "${LOCAL_INTERPRETER_REPO}" -if [[ ! -z "$ZEPPELIN_IMPERSONATE_USER" && "${INTERPRETER_ID}" != "spark" ]]; then +if [[ ! -z "$ZEPPELIN_IMPERSONATE_USER" ]]; then + if [[ "${INTERPRETER_ID}" != "spark" || "$ZEPPELIN_IMPERSONATE_SPARK_PROXY_USER" == "false" ]]; then suid="$(id -u ${ZEPPELIN_IMPERSONATE_USER})" if [[ -n "${suid}" || -z "${SPARK_SUBMIT}" ]]; then INTERPRETER_RUN_COMMAND=${ZEPPELIN_IMPERSONATE_RUN_CMD}" '" @@ -213,6 +214,7 @@ if [[ ! -z "$ZEPPELIN_IMPERSONATE_USER" && "${INTERPRETER_ID}" != "spark" ]]; th INTERPRETER_RUN_COMMAND+=" source "${ZEPPELIN_CONF_DIR}'/zeppelin-env.sh;' fi fi + fi fi if [[ -n "${SPARK_SUBMIT}" ]]; then