Skip to content
This repository was archived by the owner on Aug 2, 2019. It is now read-only.

Commit 0c8bbb4

Browse files
committed
Uses VM_DRIVER env to start minikube with specified driver
This change set adds specifying the vm-driver to be used while creating the minikube VM. Set env var `VM_DRIVER` with configured driver. See `minikube start --help` for more info. If VM_DRIVER env var is not specified, it uses the default driver configured in minikube. Also checks for exit status for creating minikube vm before proceeding further.
1 parent 342944a commit 0c8bbb4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

etc/scripts/install-on-minikube.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ KUBERNETES_VERSION=${KUBERNETES_VERSION:-v1.12.0}
1919
MEMORY=${MEMORY:-8192}
2020
CPUS=${CPUS:-4}
2121
DISK_SIZE=${DISK_SIZE:-50g}
22+
VM_DRIVER=${VM_DRIVER:-virtualbox}
2223

2324
# blow away everything in the knative profile
2425
minikube delete --profile knative
@@ -31,7 +32,12 @@ minikube config set cpus ${CPUS}
3132
minikube config set disk-size ${DISK_SIZE}
3233

3334
# Start minikube
34-
minikube start -p knative --extra-config=apiserver.enable-admission-plugins="LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook"
35-
36-
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
37-
"$DIR/install.sh" -q
35+
minikube start -p knative --vm-driver $VM_DRIVER --extra-config=apiserver.enable-admission-plugins="LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook"
36+
37+
if [ $? -eq 0 ]; then
38+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
39+
"$DIR/install.sh" -q
40+
else
41+
echo "Failed to start minikube!"
42+
exit $exit_status
43+
fi

0 commit comments

Comments
 (0)