Merge pull request #9751 from wainersm/k8s_print_logs_on_fail

tests/k8s: print logs on fail only (k8s-confidential-attestation.bats)
This commit is contained in:
Greg Kurz 2024-05-31 14:47:27 +02:00 committed by GitHub
commit 7886ed6670
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,7 +93,7 @@ teardown() {
[ -n "${pod_name:-}" ] && kubectl describe "pod/${pod_name}" || true
[ -n "${pod_config_dir:-}" ] && kubectl delete -f "${K8S_TEST_YAML}" || true
if [ -n "${node_start_time}:-}" ]; then
if [[ -n "${node_start_time}:-}" && -z "$BATS_TEST_COMPLETED" ]]; then
echo "DEBUG: system logs of node '$node' since test start time ($node_start_time)"
print_node_journal "$node" "kata" --since "$node_start_time" || true
fi