Dump kind logs after e2e tests (#4987)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-01-30 11:42:57 -03:00 committed by GitHub
parent 5d05e19cc3
commit 11192819ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
KIND_LOG_LEVEL="0" KIND_LOG_LEVEL="1"
if ! [ -z $DEBUG ]; then if ! [ -z $DEBUG ]; then
set -x set -x
@ -25,6 +25,18 @@ set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
cleanup() {
if [[ "${KUBETEST_IN_DOCKER:-}" == "true" ]]; then
kind "export" logs --name ${KIND_CLUSTER_NAME} "${ARTIFACTS}/logs" || true
fi
kind delete cluster \
--verbosity=${KIND_LOG_LEVEL} \
--name ${KIND_CLUSTER_NAME}
}
trap cleanup EXIT
if ! command -v parallel &> /dev/null; then if ! command -v parallel &> /dev/null; then
if [[ "$OSTYPE" == "linux-gnu" ]]; then if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo "Parallel is not installed. Use the package manager to install it" echo "Parallel is not installed. Use the package manager to install it"
@ -56,6 +68,7 @@ kind create cluster \
--verbosity=${KIND_LOG_LEVEL} \ --verbosity=${KIND_LOG_LEVEL} \
--name ${KIND_CLUSTER_NAME} \ --name ${KIND_CLUSTER_NAME} \
--config ${DIR}/kind.yaml \ --config ${DIR}/kind.yaml \
--retain \
--image "kindest/node:${K8S_VERSION}" --image "kindest/node:${K8S_VERSION}"
echo "Kubernetes cluster:" echo "Kubernetes cluster:"
@ -86,7 +99,3 @@ kind load docker-image --name="${KIND_CLUSTER_NAME}" ${REGISTRY}/httpbin:${TAG}
echo "[dev-env] running e2e tests..." echo "[dev-env] running e2e tests..."
make -C ${DIR}/../../ e2e-test make -C ${DIR}/../../ e2e-test
kind delete cluster \
--verbosity=${KIND_LOG_LEVEL} \
--name ${KIND_CLUSTER_NAME}