Dump kind logs after e2e tests (#4987)
This commit is contained in:
parent
5d05e19cc3
commit
11192819ff
1 changed files with 14 additions and 5 deletions
|
@ -14,7 +14,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
KIND_LOG_LEVEL="0"
|
||||
KIND_LOG_LEVEL="1"
|
||||
|
||||
if ! [ -z $DEBUG ]; then
|
||||
set -x
|
||||
|
@ -25,6 +25,18 @@ set -o errexit
|
|||
set -o nounset
|
||||
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 [[ "$OSTYPE" == "linux-gnu" ]]; then
|
||||
echo "Parallel is not installed. Use the package manager to install it"
|
||||
|
@ -56,6 +68,7 @@ kind create cluster \
|
|||
--verbosity=${KIND_LOG_LEVEL} \
|
||||
--name ${KIND_CLUSTER_NAME} \
|
||||
--config ${DIR}/kind.yaml \
|
||||
--retain \
|
||||
--image "kindest/node:${K8S_VERSION}"
|
||||
|
||||
echo "Kubernetes cluster:"
|
||||
|
@ -86,7 +99,3 @@ kind load docker-image --name="${KIND_CLUSTER_NAME}" ${REGISTRY}/httpbin:${TAG}
|
|||
|
||||
echo "[dev-env] running e2e tests..."
|
||||
make -C ${DIR}/../../ e2e-test
|
||||
|
||||
kind delete cluster \
|
||||
--verbosity=${KIND_LOG_LEVEL} \
|
||||
--name ${KIND_CLUSTER_NAME}
|
||||
|
|
Loading…
Reference in a new issue