Skip to content

Commit

Permalink
Skip preloading if running on github-hosted runners (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 authored Oct 16, 2023
1 parent 2282dd4 commit d6e1deb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/actions/start-k8s-cluster/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ runs:
run: make rebuild-cluster
working-directory: ${{ inputs.working_directory }}
shell: bash
env:
SKIP_PRELOAD_IMAGES: true

# Wait for all pods to be ready
- name: Wait for all pods ready
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ bootstrap-cluster:
# Creates a k8s cluster instance
rebuild-cluster: delete-cluster
./scripts/deploy-k8s-cluster.sh
./scripts/deploy-calico.sh
./scripts/preload-images.sh
./scripts/deploy-calico.sh
./scripts/delete-standard-storageclass.sh
./scripts/remove-control-plane-taint.sh

# Creates a k8s cluster with a single worker
rebuild-cluster-single-worker: delete-cluster
./scripts/deploy-k8s-cluster-single-worker.sh
./scripts/deploy-calico.sh
./scripts/preload-images.sh
./scripts/deploy-calico.sh
./scripts/delete-standard-storageclass.sh
./scripts/remove-control-plane-taint.sh

Expand Down
6 changes: 6 additions & 0 deletions scripts/preload-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ SCRIPT_DIR=$(dirname "$0")
# shellcheck disable=SC1091 # Not following.
source "$SCRIPT_DIR"/init-env.sh

# check if SKIP_PRELOAD_IMAGES is set to true
if [[ "$SKIP_PRELOAD_IMAGES" == "true" ]]; then
echo "Skipping image preloading"
exit 0
fi

# Exit script on error
set -e

Expand Down

0 comments on commit d6e1deb

Please sign in to comment.