From 46e62eecb1010d5c46e0b99b800ec93e428b748f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Tue, 12 Mar 2024 16:58:02 +0100 Subject: [PATCH] ci.ocp: Log the full grepped line rather than the expected msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we are grepping for an expected message but it might contain extra bits of information fruitful for later debugging. Let's include it in the output and the full log in case of an error. Signed-off-by: Lukáš Doktor --- ci/openshift-ci/cluster/install_kata.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/openshift-ci/cluster/install_kata.sh b/ci/openshift-ci/cluster/install_kata.sh index ac2581ebab..d544aa70c3 100755 --- a/ci/openshift-ci/cluster/install_kata.sh +++ b/ci/openshift-ci/cluster/install_kata.sh @@ -183,10 +183,13 @@ wait_for_app_pods_message() { done for pod in "${pods[@]}"; do while :; do - oc logs $namespace "$pod" | grep "$message" -q && echo "Found $message in $pod's log ($SECONDS)" && break; + local log=$(oc logs $namespace "$pod") + echo "$log" | grep "$message" -q && echo "Found $(echo "$log" | grep "$message") in $pod's log ($SECONDS)" && break; if [ "$SECONDS" -gt "$timeout" ]; then echo -n "Message '$message' not present in '${pod}' pod of the '-l app=\"$app\"' " echo "pods after ${SECONDS}s (${pods[@]})" + echo "Pod $pod's output so far:" + echo "$log" return -1 fi sleep 1;