Skip to content

Commit

Permalink
Fix SSH keys workaround for kubetest (#151)
Browse files Browse the repository at this point in the history
Create the `~/.ssh` dir if it doesn't exist, don't assume it always exist.

Bonus: fail fast also during cluster setup.
  • Loading branch information
adrcunha authored and knative-prow-robot committed Sep 27, 2018
1 parent b2261b0 commit 2039a3c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ function create_test_cluster() {
fi
# SSH keys are not used, but kubetest checks for their existence.
# Touch them so if they don't exist, empty files are create to satisfy the check.
mkdir -p $HOME/.ssh
touch $HOME/.ssh/google_compute_engine.pub
touch $HOME/.ssh/google_compute_engine
# Clear user and cluster variables, so they'll be set to the test cluster.
Expand Down Expand Up @@ -220,10 +221,6 @@ function create_test_cluster() {

# Setup the test cluster for running the tests.
function setup_test_cluster() {
# Fail fast during setup.
set -o errexit
set -o pipefail

# Set the required variables if necessary.
if [[ -z ${K8S_USER_OVERRIDE} ]]; then
export K8S_USER_OVERRIDE=$(gcloud config get-value core/account)
Expand Down Expand Up @@ -305,6 +302,10 @@ function initialize() {
readonly RUN_TESTS
readonly EMIT_METRICS

# Fail fast during setup.
set -o errexit
set -o pipefail

if (( ! RUN_TESTS )); then
create_test_cluster
else
Expand Down

0 comments on commit 2039a3c

Please sign in to comment.