From 1d88a3f866f2920ab7cd758debad780385987e62 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Thu, 11 Mar 2021 16:36:44 -0800 Subject: [PATCH] Print csi plugin logs at end of e2e test --- hack/e2e/run.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index 595d5ef534..e04cd312a1 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -24,6 +24,7 @@ source "${BASE_DIR}"/kops.sh source "${BASE_DIR}"/util.sh DRIVER_NAME=${DRIVER_NAME:-aws-ebs-csi-driver} +CONTAINER_NAME=${CONTAINER_NAME:-ebs-plugin} TEST_ID=${TEST_ID:-$RANDOM} CLUSTER_NAME=test-cluster-${TEST_ID}.k8s.local @@ -139,6 +140,15 @@ if [[ "${EBS_CHECK_MIGRATION}" == true ]]; then fi fi +PODS=$(kubectl get pod -n kube-system -l "app.kubernetes.io/name=${DRIVER_NAME},app.kubernetes.io/instance=${DRIVER_NAME}" -o json | jq -r .items[].metadata.name) + +while IFS= read -r POD; do + loudecho "Printing pod ${POD} ${CONTAINER_NAME} container logs" + set +e + kubectl logs "${POD}" -n kube-system "${CONTAINER_NAME}" + set -e +done <<< "${PODS}" + if [[ "${CLEAN}" == true ]]; then loudecho "Cleaning"