Skip to content

Commit 797c6af

Browse files
authored
fix: reintroduce env var CONTAINERDEBUG_LOG_DIRECTORY (#670)
* fix: reintroduce env var CONTAINERDEBUG_LOG_DIRECTORY * factor out ctnrdebug test
1 parent 4e632b1 commit 797c6af

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

rust/operator-binary/src/controller.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,10 @@ fn build_server_rolegroup_daemonset(
863863
&opa_container_name,
864864
)])
865865
.add_env_vars(env)
866+
.add_env_var(
867+
"CONTAINERDEBUG_LOG_DIRECTORY",
868+
format!("{STACKABLE_LOG_DIR}/containerdebug"),
869+
)
866870
.add_container_port(APP_PORT_NAME, APP_PORT.into())
867871
.add_volume_mount(CONFIG_VOLUME_NAME, CONFIG_DIR)
868872
.context(AddVolumeMountSnafu)?

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,3 @@ spec:
3232
- name: vector
3333
{% endif %}
3434
terminationGracePeriodSeconds: 125 # 2 minutes + 5s safety buffer
35-
---
36-
# This test checks if the containerdebug-state.json file is present and valid
37-
apiVersion: kuttl.dev/v1beta1
38-
kind: TestAssert
39-
timeout: 600
40-
commands:
41-
- script: |
42-
FIRST_OPA_POD=$(kubectl get -n $NAMESPACE pods --field-selector=status.phase=Running --selector app.kubernetes.io/instance=test-opa -o jsonpath='{.items[0].metadata.name}')
43-
kubectl exec -n $NAMESPACE --container opa $FIRST_OPA_POD -- cat /stackable/log/containerdebug-state.json | jq --exit-status
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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: |
8+
FIRST_OPA_POD=$(kubectl get -n $NAMESPACE pods --field-selector=status.phase=Running --selector app.kubernetes.io/instance=test-opa -o jsonpath='{.items[0].metadata.name}')
9+
kubectl exec -n $NAMESPACE --container opa $FIRST_OPA_POD -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valid JSON"'

0 commit comments

Comments
 (0)