From 74180a52b333923b80b8ee002543f06ae04b5aef Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Sun, 15 Dec 2024 17:13:36 +0100 Subject: [PATCH 1/2] reintroduce the CONTAINERDEBUG_LOG_DIRECTORY env var --- rust/operator-binary/src/env_vars.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rust/operator-binary/src/env_vars.rs b/rust/operator-binary/src/env_vars.rs index e1e77a5b..394183e3 100644 --- a/rust/operator-binary/src/env_vars.rs +++ b/rust/operator-binary/src/env_vars.rs @@ -217,6 +217,16 @@ pub fn build_airflow_statefulset_envs( } } + // Needed for the `containerdebug` process to log it's tracing information to. + env.insert( + "CONTAINERDEBUG_LOG_DIRECTORY".to_string(), + EnvVar { + name: "CONTAINERDEBUG_LOG_DIRECTORY".to_string(), + value: Some(format!("{STACKABLE_LOG_DIR}/containerdebug")), + value_from: None, + }, + ); + tracing::debug!("Env-var set [{:?}]", env); transform_map_to_vec(env) } From 9c8828e5410c4c4c5722311dbcd5136ede8ff425 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:41:29 +0100 Subject: [PATCH 2/2] factor out ctnrdebug test --- tests/templates/kuttl/smoke/40-assert.yaml.j2 | 8 -------- tests/templates/kuttl/smoke/42-assert.yaml | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 tests/templates/kuttl/smoke/42-assert.yaml diff --git a/tests/templates/kuttl/smoke/40-assert.yaml.j2 b/tests/templates/kuttl/smoke/40-assert.yaml.j2 index ac428045..81337261 100644 --- a/tests/templates/kuttl/smoke/40-assert.yaml.j2 +++ b/tests/templates/kuttl/smoke/40-assert.yaml.j2 @@ -79,11 +79,3 @@ status: expectedPods: 1 currentHealthy: 1 disruptionsAllowed: 1 ---- -# This test checks if the containerdebug-state.json file is present and valid -apiVersion: kuttl.dev/v1beta1 -kind: TestAssert -timeout: 600 -commands: - - script: kubectl exec -n $NAMESPACE --container airflow airflow-scheduler-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status - - script: kubectl exec -n $NAMESPACE --container airflow airflow-webserver-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status diff --git a/tests/templates/kuttl/smoke/42-assert.yaml b/tests/templates/kuttl/smoke/42-assert.yaml new file mode 100644 index 00000000..46ced0d2 --- /dev/null +++ b/tests/templates/kuttl/smoke/42-assert.yaml @@ -0,0 +1,8 @@ +--- +# This test checks if the containerdebug-state.json file is present and valid +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +timeout: 600 +commands: + - script: kubectl exec -n $NAMESPACE --container airflow airflow-scheduler-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valid JSON"' + - script: kubectl exec -n $NAMESPACE --container airflow airflow-webserver-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valid JSON"'