You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by xx...@apache.org on 2023/07/06 05:53:29 UTC
[kylin] 12/19: KYLIN-5605 fix kerberosEnabled is null in FI platform (#30279)
This is an automated email from the ASF dual-hosted git repository.
xxyu pushed a commit to branch kylin5
in repository https://gitbox.apache.org/repos/asf/kylin.git
commit 52694a13cfed691f80a0c7d5096eb1a7c5a1c18e
Author: Liang.Hua <36...@users.noreply.github.com>
AuthorDate: Tue Apr 11 17:35:15 2023 +0800
KYLIN-5605 fix kerberosEnabled is null in FI platform (#30279)
* KYLIN-5605 fix kerberosEnabled is null in FI platform
---------
Co-authored-by: liang.hua <li...@kyligence.io>
---
build/sbin/replace-jars-under-spark.sh | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/build/sbin/replace-jars-under-spark.sh b/build/sbin/replace-jars-under-spark.sh
index 00a0d31971..783c5e11b6 100755
--- a/build/sbin/replace-jars-under-spark.sh
+++ b/build/sbin/replace-jars-under-spark.sh
@@ -23,6 +23,26 @@ BYPASS=${SPARK_HOME}/jars/replace-jars-bypass
# replace when has Kerberos, or can't get the value (eg: in FI platform)
kerberosEnabled=`${KYLIN_HOME}/bin/get-properties.sh kylin.kerberos.enabled`
+
+function get_config_from_props_file() {
+ configKey=$1
+ configValue=
+ if [ -f ${KYLIN_HOME}/conf/kylin.properties.override ]; then
+ configValue=$(grep -Ev '^$|^\s*#' ${KYLIN_HOME}/conf/kylin.properties.override | grep -E ''"${configKey}"'' | awk -F= '/^'"${configKey}"'=/ { val=$2 } END { print val }')
+ fi
+
+ if [[ -z "${configValue}" && -f ${KYLIN_HOME}/conf/kylin.properties ]]; then
+ configValue=$(grep -Ev '^$|^\s*#' ${KYLIN_HOME}/conf/kylin.properties | grep -E ''"${configKey}"'' | awk -F= '/^'"${configKey}"'=/ { val=$2 } END { print val }')
+ fi
+
+ echo "${configValue}"
+ return 1
+}
+
+if [ -z "${kerberosEnabled}" ]; then
+ kerberosEnabled=$(get_config_from_props_file '(kylin|kap).kerberos.enabled')
+fi
+
if [[ "${kerberosEnabled}" != "true" || -f ${BYPASS} ]]
then
return