diff --git a/Makefile b/Makefile index 7db8339aff..5554088e1c 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,6 @@ vagrant: ## Run vagrant against a previously up'd cluster. Example: make vagrant vagrant-destroy: ## Destroy a previously created local VM cluster @hack/vagrant-destroy.sh - @HACK_MULTI_NODE="true" hack/vagrant-destroy.sh vagrant-clean: vagrant-destroy ## Destroy a previously created local VM cluster and remove all downloaded/generated assets @rm -rf hack/_output diff --git a/hack/vagrant-destroy.sh b/hack/vagrant-destroy.sh index b20916b6cd..cbf0a20630 100755 --- a/hack/vagrant-destroy.sh +++ b/hack/vagrant-destroy.sh @@ -8,6 +8,11 @@ export HACK_DIR # shellcheck source=vagrant-common.sh . "${HACK_DIR}/vagrant-common.sh" +if [ ! -d "${BK_CLONE_DIR}" ]; then + echo "INFO: Bootkube repo not found. Nothing to destroy." + exit 0 +fi + for i in "${BK_CLONE_DIR}/hack/single-node" "${BK_CLONE_DIR}/hack/multi-node"; do echo "INFO: Running vagrant destroy -f in ${i}" cd "${i}"