@@ -21,18 +21,26 @@ use crate::{
2121
2222/// Config directory used in the Vector log agent container
2323const STACKABLE_CONFIG_DIR : & str = "/stackable/config" ;
24+
2425/// Directory in the Vector container which contains a subdirectory for every container which
2526/// themselves contain the corresponding log files
2627const STACKABLE_LOG_DIR : & str = "/stackable/log" ;
28+
2729/// Subdirectory of the log directory containing files to control the Vector instance
2830const VECTOR_LOG_DIR : & str = "_vector" ;
31+
32+ /// Subdirectory of the log directory containing the Vector state data
33+ const VECTOR_STATE_DIR : & str = "_vector-state" ;
34+
2935/// File to signal that Vector should be gracefully shut down
3036const SHUTDOWN_FILE : & str = "shutdown" ;
3137
3238/// File name of the Vector config file
3339pub const VECTOR_CONFIG_FILE : & str = "vector.yaml" ;
40+
3441/// Key in the discovery ConfigMap that holds the vector aggregator address
3542const VECTOR_AGGREGATOR_CM_KEY : & str = "ADDRESS" ;
43+
3644/// Name of the env var in the vector container that holds the vector aggregator address
3745const VECTOR_AGGREGATOR_ENV_NAME : & str = "VECTOR_AGGREGATOR_ADDRESS" ;
3846
@@ -705,7 +713,7 @@ where
705713 } ;
706714
707715 format ! (
708- r#"data_dir: /stackable/vector/var
716+ r#"data_dir: {STACKABLE_LOG_DIR}/{VECTOR_STATE_DIR}
709717
710718log_schema:
711719 host_key: pod
@@ -1436,6 +1444,7 @@ pub fn vector_container(
14361444 // exec vector --config {STACKABLE_CONFIG_DIR}/{VECTOR_CONFIG_FILE}
14371445 . args ( vec ! [ format!(
14381446 "\
1447+ mkdir --parents {STACKABLE_LOG_DIR}/{VECTOR_STATE_DIR}
14391448# Vector will ignore SIGTERM (as PID != 1) and must be shut down by writing a shutdown trigger file
14401449vector --config {STACKABLE_CONFIG_DIR}/{VECTOR_CONFIG_FILE} & vector_pid=$!
14411450if [ ! -f \" {STACKABLE_LOG_DIR}/{VECTOR_LOG_DIR}/{SHUTDOWN_FILE}\" ]; then
0 commit comments