From 0e3ef5a62892d7b01777232eaaf9db413b8b1797 Mon Sep 17 00:00:00 2001 From: Matthew Booth Date: Thu, 30 Jan 2025 13:42:36 +0000 Subject: [PATCH] CI: Log ORC resources when e2e exits with failure --- hack/e2e.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hack/e2e.sh b/hack/e2e.sh index c77bc9ef..b47b0d4a 100755 --- a/hack/e2e.sh +++ b/hack/e2e.sh @@ -32,6 +32,16 @@ make load-credentials # Apply the cirros server example and wait for the server to be available kubectl apply -k apply/cirros --server-side + +function logresources() { + # If we're exiting with an error + if [ $? != 0 ]; then + # Dump the complete state of all ORC objects + kubectl get openstack -o yaml -A + fi +} +trap logresources EXIT + kubectl wait --timeout=10m --for=condition=available server ${USER}-cirros-server openstack server show "$(kubectl get server ${USER}-cirros-server -o jsonpath='{.status.id}')"