diff --git a/devel/ci-cluster.sh b/devel/ci-cluster.sh index 63aa4c7d8..3850534ab 100755 --- a/devel/ci-cluster.sh +++ b/devel/ci-cluster.sh @@ -22,11 +22,6 @@ set -o pipefail # This is intended to be run in a CI environment and *not* for development. # It is not optimised for quick, iterative development. -export_logs() { - echo "Exporting cluster logs to artifacts..." - "${SCRIPT_ROOT}/cluster/export-logs.sh" -} - SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )" export REPO_ROOT="${SCRIPT_ROOT}/.." source "${SCRIPT_ROOT}/lib/lib.sh" @@ -39,13 +34,14 @@ if [[ "$IS_OPENSHIFT" == "true" ]] ; then export SERVICE_IP_PREFIX="172.30.0" fi -# When running in our CI environment the Docker network's subnet choice will cause issues with routing -# This works this around till we have a way to properly patch this. +# When running in our CI environment the Docker network's subnet choice will +# cause issues with routing. This works this around till we have a way to +# properly patch this. if ! docker network inspect kind ; then docker network create --driver=bridge --subnet=192.168.0.0/16 --gateway 192.168.0.1 kind fi -# Wait for the network to be created so kind does not overwrite it +# Wait for the network to be created so kind does not overwrite it. while ! docker network inspect kind ; do sleep 100ms done diff --git a/devel/ci-run-e2e.sh b/devel/ci-run-e2e.sh index 30e2be97b..574206f06 100755 --- a/devel/ci-run-e2e.sh +++ b/devel/ci-run-e2e.sh @@ -24,6 +24,7 @@ set -o pipefail SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )" export REPO_ROOT="${SCRIPT_ROOT}/.." +source "${SCRIPT_ROOT}/lib/lib.sh" # Ensure a running Kubernetes cluster "${SCRIPT_ROOT}/ci-cluster.sh" diff --git a/devel/lib/lib.sh b/devel/lib/lib.sh index 08bd51d6c..f94ee6c13 100644 --- a/devel/lib/lib.sh +++ b/devel/lib/lib.sh @@ -110,3 +110,8 @@ load_image() { fi kind load docker-image --name "$KIND_CLUSTER_NAME" "$IMAGE_NAME" } + +export_logs() { + echo "Exporting cluster logs to artifacts..." + "${SCRIPT_ROOT}/cluster/export-logs.sh" +}