Skip to content

Commit

Permalink
ci: use the host /sbin/losetup in minikube VM
Browse files Browse the repository at this point in the history
minikube has /sbin/losetup from Busybox, and that does not work with
raw-block PVCs. Use the losetup executable from the host in the VM
instead.

See-also: kubernetes/minikube#8284
Signed-off-by: Niels de Vos <ndevos@redhat.com>
  • Loading branch information
nixpanic committed Jul 31, 2020
1 parent c0c3fcc commit 0130548
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/minikube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ function disable_storage_addons() {
${minikube} addons disable storage-provisioner 2>/dev/null || true
}

# minikube has the Busybox losetup, and that does not work with raw-block PVCs.
# Copy the host losetup executable and hope it works.
#
# See https://github.com/kubernetes/minikube/issues/8284
function minikube_losetup() {
# scp should not ask for any confirmation
scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i "$(${minikube} ssh-key)" /sbin/losetup docker@"$(${minikube} ip)":losetup
# replace /sbin/losetup symlink with the executable
${minikube} ssh 'sudo sh -c "rm -f /sbin/losetup && cp ~docker/losetup /sbin"'
}

# configure minikube
MINIKUBE_ARCH=${MINIKUBE_ARCH:-"amd64"}
MINIKUBE_VERSION=${MINIKUBE_VERSION:-"latest"}
Expand Down Expand Up @@ -167,6 +178,7 @@ up)
wait_for_ssh
# shellcheck disable=SC2086
${minikube} ssh "sudo mkdir -p /mnt/${DISK}/var/lib/rook;sudo ln -s /mnt/${DISK}/var/lib/rook /var/lib/rook"
minikube_losetup
fi
${minikube} kubectl -- cluster-info
;;
Expand Down

0 comments on commit 0130548

Please sign in to comment.