Skip to content

Commit 7cb737f

Browse files
committed
[SPARK-52647] Fix jvmArgs to support multiple arguments
### What changes were proposed in this pull request? This PR aims to fix `jvmArgs` parameter to support multiple arguments. https://github.com/apache/spark-kubernetes-operator/blob/a50f4533225d5e2059796426cdfbdf25747dd56a/build-tools/helm/spark-kubernetes-operator/templates/spark-operator.yaml#L104-L105 ### Why are the changes needed? The previous syntax, `"$OPERATOR_JAVA_OPTS"`, cannot handle multiple Java options. https://github.com/apache/spark-kubernetes-operator/blob/a50f4533225d5e2059796426cdfbdf25747dd56a/build-tools/docker/docker-entrypoint.sh#L29 ``` $ cat test.sh OPERATOR_JAVA_OPTS="-Dfile.encoding=UTF8 -XX:+ExitOnOutOfMemoryError" exec java "$OPERATOR_JAVA_OPTS" -XX:+PrintFlagsFinal -version $ sh test.sh | grep ExitOnOutOfMemoryError bool ExitOnOutOfMemoryError = false {product} {default} openjdk version "21.0.7" 2025-04-15 OpenJDK Runtime Environment Homebrew (build 21.0.7) OpenJDK 64-Bit Server VM Homebrew (build 21.0.7, mixed mode, sharing) ``` ### Does this PR introduce _any_ user-facing change? Yes. This is a bug fix. ### How was this patch tested? Manual review because JVM option check is a little tricky. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#267 from dongjoon-hyun/SPARK-52647. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent a50f453 commit 7cb737f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build-tools/docker/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if [ "$1" = "help" ]; then
2626
elif [ "$1" = "operator" ]; then
2727
echo "Starting Operator..."
2828

29-
exec java -cp "./$SPARK_OPERATOR_JAR" "$LOG_CONFIG" "$OPERATOR_JAVA_OPTS" org.apache.spark.k8s.operator.SparkOperator
29+
exec java -cp "./$SPARK_OPERATOR_JAR" "$LOG_CONFIG" $OPERATOR_JAVA_OPTS org.apache.spark.k8s.operator.SparkOperator
3030
fi
3131

3232
args=("${args[@]}")

0 commit comments

Comments
 (0)