File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
tests/templates/kuttl/logging Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -7,4 +7,4 @@ commands:
77 python /tmp/test_log_aggregation.py -n $NAMESPACE
88 - script : >-
99 kubectl exec --namespace=$NAMESPACE opa-test-runner-0 --
10- sh /tmp/test_log_aggregation.sh
10+ /tmp/test_log_aggregation.sh
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- DECISION_LOGS=$( kubectl logs service/test-opa-server -c opa | grep " decision_id" ) ;
3+ # we should distinguish between cases where the variable is not set
4+ # if the service or container is not found (which we don't want), and where
5+ # grep does not find anything (which is what we *do* want).
6+
7+ set -Eeuo pipefail
8+
9+ # do not mask kubectl errors, but the right-hand group must always be true
10+ # so the test does not fail on the grep
11+ DECISION_LOGS=$( kubectl logs service/test-opa-server -c opa | { grep " decision_id" || true ; })
412
513if [ -n " $DECISION_LOGS " ];
614then
You can’t perform that action at this time.
0 commit comments