Skip to content

Commit cede3e0

Browse files
committed
fix: ensure spark entrypoint executes the post hook
1 parent bd6b3a6 commit cede3e0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

spark-k8s/stackable/run-spark.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#!/bin/bash
22

3+
SPARK_CONTAINER_EXIT_CODE=0
4+
35
eval "$_STACKABLE_PRE_HOOK"
46

5-
/stackable/spark/kubernetes/dockerfiles/spark/entrypoint.sh "$@"
6-
result=$?
7+
cleanup() {
8+
eval "$_STACKABLE_POST_HOOK"
9+
exit $SPARK_CONTAINER_EXIT_CODE
10+
}
711

8-
eval "$_STACKABLE_POST_HOOK"
12+
trap 'cleanup' SIGTERM SIGINT
13+
14+
/stackable/spark/kubernetes/dockerfiles/spark/entrypoint.sh "$@"
15+
SPARK_CONTAINER_EXIT_CODE=$?
916

10-
exit $result
17+
cleanup

0 commit comments

Comments
 (0)