diff --git a/rust/operator-binary/src/controller.rs b/rust/operator-binary/src/controller.rs index 281f0a12..e7968ffb 100644 --- a/rust/operator-binary/src/controller.rs +++ b/rust/operator-binary/src/controller.rs @@ -863,6 +863,10 @@ fn build_server_rolegroup_daemonset( &opa_container_name, )]) .add_env_vars(env) + .add_env_var( + "CONTAINERDEBUG_LOG_DIRECTORY", + format!("{STACKABLE_LOG_DIR}/containerdebug"), + ) .add_container_port(APP_PORT_NAME, APP_PORT.into()) .add_volume_mount(CONFIG_VOLUME_NAME, CONFIG_DIR) .context(AddVolumeMountSnafu)? diff --git a/tests/templates/kuttl/smoke/10-assert.yaml.j2 b/tests/templates/kuttl/smoke/10-assert.yaml.j2 index 7f0b7ff0..6b86f13f 100644 --- a/tests/templates/kuttl/smoke/10-assert.yaml.j2 +++ b/tests/templates/kuttl/smoke/10-assert.yaml.j2 @@ -32,12 +32,3 @@ spec: - name: vector {% endif %} terminationGracePeriodSeconds: 125 # 2 minutes + 5s safety buffer ---- -# This test checks if the containerdebug-state.json file is present and valid -apiVersion: kuttl.dev/v1beta1 -kind: TestAssert -timeout: 600 -commands: - - script: | - 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}') - kubectl exec -n $NAMESPACE --container opa $FIRST_OPA_POD -- cat /stackable/log/containerdebug-state.json | jq --exit-status diff --git a/tests/templates/kuttl/smoke/11-assert.yaml b/tests/templates/kuttl/smoke/11-assert.yaml new file mode 100644 index 00000000..3136c288 --- /dev/null +++ b/tests/templates/kuttl/smoke/11-assert.yaml @@ -0,0 +1,9 @@ +--- +# This test checks if the containerdebug-state.json file is present and valid +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +timeout: 600 +commands: + - script: | + 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}') + kubectl exec -n $NAMESPACE --container opa $FIRST_OPA_POD -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valid JSON"'