From 49926446f998da465f949e97f1acd86e6837eb30 Mon Sep 17 00:00:00 2001 From: zjx20 Date: Fri, 30 Aug 2024 10:05:51 +0800 Subject: [PATCH] ci: make minikube.sh work on macOS M1 with the qemu2 driver 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 --- scripts/minikube.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/minikube.sh b/scripts/minikube.sh index b17f6883798..13ad8b6dd42 100755 --- a/scripts/minikube.sh +++ b/scripts/minikube.sh @@ -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 @@ -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)