Merge pull request #11615 from olemarkus/e2e-upgrade-sledgehammer

Dump all CP node logs to artifacts
This commit is contained in:
Kubernetes Prow Robot 2021-05-28 08:02:26 -07:00 committed by GitHub
commit 5e7c6da57e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -46,10 +46,20 @@ KOPS="${FIRST_KOPS}"
# Always tear-down the cluster when we're done # Always tear-down the cluster when we're done
function finish { function finish {
KOPS_LOG_DIR="${ARTIFACTS}/logs"
mkdir -p "${KOPS_LOG_DIR}"
KOPS_CP=$(${KOPS} toolbox dump -o json | jq -r '.instances[] | select( .roles | index("master" )) | .publicAddresses[0]')
ssh -i "${AWS_SSH_PRIVATE_KEY_FILE}" "ubuntu@${KOPS_CP}" sudo chmod -R a+r /var/log
scp -i "${AWS_SSH_PRIVATE_KEY_FILE}" -r "ubuntu@${KOPS_CP}:/var/log/" "${KOPS_LOG_DIR}"
${KUBETEST2} --kops-binary-path="${KOPS}" --down || echo "kubetest2 down failed" ${KUBETEST2} --kops-binary-path="${KOPS}" --down || echo "kubetest2 down failed"
} }
trap finish EXIT trap finish EXIT
${KUBETEST2} \ ${KUBETEST2} \
--up \ --up \
--kubernetes-version="${K8S_VERSION}" \ --kubernetes-version="${K8S_VERSION}" \