Skip to content

Commit

Permalink
Print csi plugin logs at end of e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
wongma7 committed Mar 12, 2021
1 parent ee3b46c commit 1d88a3f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hack/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand Down

0 comments on commit 1d88a3f

Please sign in to comment.