File tree Expand file tree Collapse file tree 4 files changed +28
-3
lines changed
tests/templates/kuttl/smoke Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -527,7 +527,13 @@ fn build_stateful_set(
527527 . context ( InvalidContainerNameSnafu ) ?
528528 . image_from_product_image ( resolved_product_image)
529529 . resources ( merged_config. resources . clone ( ) . into ( ) )
530- . command ( vec ! [ "/bin/bash" . to_string( ) ] )
530+ . command ( vec ! [
531+ "/bin/bash" . to_string( ) ,
532+ "-x" . to_string( ) ,
533+ "-euo" . to_string( ) ,
534+ "pipefail" . to_string( ) ,
535+ "-c" . to_string( ) ,
536+ ] )
531537 . args ( command_args ( log_dir) )
532538 . add_container_port ( "http" , 18080 )
533539 . add_container_port ( "metrics" , METRICS_PORT . into ( ) )
@@ -751,10 +757,10 @@ fn command_args(logdir: &ResolvedLogDir) -> Vec<String> {
751757 }
752758
753759 command. extend ( vec ! [
760+ format!( "CONTAINERDEBUG_LOG_DIRECTORY={VOLUME_MOUNT_PATH_LOG}/containerdebug containerdebug --output={VOLUME_MOUNT_PATH_LOG}/containerdebug-state.json --loop &" ) ,
754761 format!( "/stackable/spark/sbin/start-history-server.sh --properties-file {VOLUME_MOUNT_PATH_CONFIG}/{SPARK_DEFAULTS_FILE_NAME}" ) ,
755762 ] ) ;
756-
757- vec ! [ String :: from( "-c" ) , command. join( " && " ) ]
763+ vec ! [ command. join( "\n " ) ]
758764}
759765
760766fn labels < ' a , T > (
Original file line number Diff line number Diff line change @@ -594,6 +594,11 @@ fn pod_template(
594594 . resources ( config. resources . clone ( ) . into ( ) )
595595 . image_from_product_image ( spark_image) ;
596596
597+ cb. add_env_var (
598+ "_STACKABLE_PRE_HOOK" ,
599+ format ! ( "CONTAINERDEBUG_LOG_DIRECTORY={VOLUME_MOUNT_PATH_LOG}/containerdebug containerdebug --output={VOLUME_MOUNT_PATH_LOG}/containerdebug-state.json --loop &" ) ,
600+ ) ;
601+
597602 if config. logging . enable_vector_agent {
598603 cb. add_env_var (
599604 "_STACKABLE_POST_HOOK" ,
Original file line number Diff line number Diff line change @@ -9,3 +9,10 @@ metadata:
99 name : spark-history-node-default
1010status :
1111 readyReplicas : 1
12+ ---
13+ # This test checks if the containerdebug-state.json file is present and valid
14+ apiVersion : kuttl.dev/v1beta1
15+ kind : TestAssert
16+ timeout : 600
17+ commands :
18+ - script : kubectl exec -n $NAMESPACE --container airflow spark-history-node-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status
Original file line number Diff line number Diff line change @@ -9,3 +9,10 @@ metadata:
99 name : spark-pi-s3-1
1010status :
1111 phase : Succeeded
12+ ---
13+ # This test checks if the containerdebug-state.json file is present and valid
14+ apiVersion : kuttl.dev/v1beta1
15+ kind : TestAssert
16+ timeout : 600
17+ commands :
18+ - script : kubectl exec -n $NAMESPACE --container airflow spark-history-node-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status
You can’t perform that action at this time.
0 commit comments