Environment Setup: Hyper‐V with shared drives - microsoft/cluster-api-inplace-updater GitHub Wiki

Overview

In this setup:

  • development happens in Windows;
  • testing happens in Ubuntu (Hyper-V);
  • files are shared by Hyper-V's Shared Drives.

Setup

Side note: microsoft/linux-vm-tools (Hyper-V Linux Guest VM Enhancements) has been archived. It is not trivial to integrate Ubuntu with Hyper-V which is created in the traditional way without Quick Create.

Tips

Run selected E2E

make GINKGO_FOCUS="When upgrading a workload cluster using ClusterClass \\[ClusterClass\\]" capi-test-e2e

Troubleshooting

Makefile: *** target pattern contains no '%'. Stop.

This is due to the path for a shared drive which contains :.

mkdir ~/P
bindfs --no-allow-other ~/shared-drives/P: ~/P

ln: failed to create symbolic link: Function not implemented

This is related to bindfs. Modify cluster-api/scripts/go_install.sh as workaround.

# install the golang module specified as the first argument
go install "${1}@${3}"
# mv "${GOBIN}/${2}" "${GOBIN}/${2}-${3}"
# ln -sf "${GOBIN}/${2}-${3}" "${GOBIN}/${2}"
cp "${GOBIN}/${2}" "${GOBIN}/${2}-${3}"

hack/version.sh: Permission denied

This is because the execution permission is not available on version.sh.

chmod +x cluster-api/hack/version.sh

scripts/go_install.sh: Permission denied

This is because the execution permission is not available on go_install.sh.

chmod +x cluster-api/scripts/go_install.sh

/usr/bin/env: ‘bash\r’: No such file or directory

This is related to CRLF.

git config core.autocrlf false 
git rm --cached -r . 
git reset --hard

Too many open files

This is related to Docker.

sudo sysctl fs.inotify.max_user_watches=1048576
sudo sysctl fs.inotify.max_user_instances=8192

panic: Your Test Panicked: Expect(os.MkdirAll(filepath.Dir(logMetadataFile), 0750)).To(Succeed())

This is due to the path which is too long.