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

Commit 56ccf44

Browse files
committed
feat(minishift): Respect vm-driver on multiple levels
The vm-driver to choose will be detected by (in this order): * from the env var VM_DRIVER * from the minishift vm-driver config in the *minishift* profile * "hyperkit" on macOs If none is found, then minishift is started without vm-driver option (which falls back to minishift defaults)
1 parent 2457ccb commit 56ccf44

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

etc/scripts/install-on-minishift.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,23 @@ OPENSHIFT_VERSION=${OPENSHIFT_VERSION:-v3.11.0}
1515
MEMORY=${MEMORY:-10GB}
1616
CPUS=${CPUS:-4}
1717
DISK_SIZE=${DISK_SIZE:-50g}
18-
VM_DRIVER=${VM_DRIVER:-}
1918

20-
# Set hyperkit as default on macOs
21-
if [[ -z "${OSTYPE}" && $(uname) == "Darwin" ]] || [ "${OSTYPE#darwin}" != "${OSTYPE}" ]; then
22-
VM_DRIVER=${VM_DRIVER:-hyperkit}
19+
if [ -z "${VM_DRIVER}" ]; then
20+
# check for default driver
21+
VM_DRIVER=$(minishift config get vm-driver --profile minishift)
22+
if [ -z "$VM_DRIVER" ] || [ $VM_DRIVER = "<nil>" ]; then
23+
if [[ -z "${OSTYPE}" && $(uname) == "Darwin" ]] || [ "${OSTYPE#darwin}" != "${OSTYPE}" ]; then
24+
# set hyperkit as default on macOs
25+
VM_DRIVER="hyperkit"
26+
else
27+
# no driver to set
28+
VM_DRIVER=""
29+
fi
30+
fi
2331
fi
2432

2533
# blow away everything in the knative profile
26-
minishift profile delete knative --force
34+
minishift profile delete knative --force >/dev/null 2>&1
2735

2836
# configure knative profile
2937
minishift profile set knative

0 commit comments

Comments
 (0)