Skip to content

Commit eba47b3

Browse files
authored
reintroduce the CONTAINERDEBUG_LOG_DIRECTORY env var (#563)
* reintroduce the CONTAINERDEBUG_LOG_DIRECTORY env var * factor out ctnrdebug test
1 parent ca1464a commit eba47b3

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

rust/operator-binary/src/env_vars.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ pub fn build_airflow_statefulset_envs(
217217
}
218218
}
219219

220+
// Needed for the `containerdebug` process to log it's tracing information to.
221+
env.insert(
222+
"CONTAINERDEBUG_LOG_DIRECTORY".to_string(),
223+
EnvVar {
224+
name: "CONTAINERDEBUG_LOG_DIRECTORY".to_string(),
225+
value: Some(format!("{STACKABLE_LOG_DIR}/containerdebug")),
226+
value_from: None,
227+
},
228+
);
229+
220230
tracing::debug!("Env-var set [{:?}]", env);
221231
transform_map_to_vec(env)
222232
}

tests/templates/kuttl/smoke/40-assert.yaml.j2

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,3 @@ status:
7979
expectedPods: 1
8080
currentHealthy: 1
8181
disruptionsAllowed: 1
82-
---
83-
# This test checks if the containerdebug-state.json file is present and valid
84-
apiVersion: kuttl.dev/v1beta1
85-
kind: TestAssert
86-
timeout: 600
87-
commands:
88-
- script: kubectl exec -n $NAMESPACE --container airflow airflow-scheduler-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status
89-
- script: kubectl exec -n $NAMESPACE --container airflow airflow-webserver-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# This test checks if the containerdebug-state.json file is present and valid
3+
apiVersion: kuttl.dev/v1beta1
4+
kind: TestAssert
5+
timeout: 600
6+
commands:
7+
- script: kubectl exec -n $NAMESPACE --container airflow airflow-scheduler-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valid JSON"'
8+
- script: kubectl exec -n $NAMESPACE --container airflow airflow-webserver-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valid JSON"'

0 commit comments

Comments
 (0)