Skip to content

Commit

Permalink
ci: make minikube.sh work on macOS M1 with the qemu2 driver
Browse files Browse the repository at this point in the history
To utilize minikube on macOS M1, the qemu2 VM driver is currently the
only viable option. Therefore, the following modifications have been
implemented:
* the RESOLV_CONF variable has been made configurable because it needs
to be overridden as /etc/resolv.conf when using the qemu2 driver.
* adding additional disks when using the qemu2 driver.

Signed-off-by: zjx20 <zhoujianxiong2@gmail.com>
  • Loading branch information
zjx20 authored and mergify[bot] committed Sep 10, 2024
1 parent d3733a0 commit 4992644
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/minikube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ if [[ "${VM_DRIVER}" == "kvm2" ]]; then
DISK="vda1"
fi

if [[ "${VM_DRIVER}" == "kvm2" ]] || [[ "${VM_DRIVER}" == "hyperkit" ]]; then
if [[ "${VM_DRIVER}" == "kvm2" ]] || [[ "${VM_DRIVER}" == "hyperkit" ]] || [[ "${VM_DRIVER}" == "qemu2" ]]; then
# adding extra disks is only supported on kvm2 and hyperkit
DISK_CONFIG=${DISK_CONFIG:-" --extra-disks=${NUM_DISKS} --disk-size=${DISK_SIZE} "}
else
Expand All @@ -219,7 +219,7 @@ K8S_FEATURE_GATES=${K8S_FEATURE_GATES:-""}

# kubelet.resolv-conf needs to point to a file, not a symlink
# the default minikube VM has /etc/resolv.conf -> /run/systemd/resolve/resolv.conf
RESOLV_CONF='/run/systemd/resolve/resolv.conf'
RESOLV_CONF="${RESOLV_CONF:-/run/systemd/resolve/resolv.conf}"
if { [[ "${VM_DRIVER}" == "none" ]] || [[ "${VM_DRIVER}" == "podman" ]]; } && [[ ! -e "${RESOLV_CONF}" ]]; then
# in case /run/systemd/resolve/resolv.conf does not exist, use the
# standard /etc/resolv.conf (with symlink resolved)
Expand Down

0 comments on commit 4992644

Please sign in to comment.